From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Ulf Samuelsson <ulf@emagii.com>
Subject: [PATCH v1 3/3] CHIP: language additions
Date: Tue, 14 Mar 2023 23:01:14 +0100 [thread overview]
Message-ID: <20230314220114.1117782-4-binutils@emagii.com> (raw)
In-Reply-To: <20230314220114.1117782-1-binutils@emagii.com>
From: Ulf Samuelsson <ulf@emagii.com>
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
---
ld/ldfile.c | 29 ++++++++++++++++++++++++++++-
ld/ldfile.h | 2 ++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/ld/ldfile.c b/ld/ldfile.c
index b8fd4e5d8e0..9e9099dafae 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -710,7 +710,6 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
einfo (_("%F%P: cannot open linker script file %s: %E\n"), name);
return;
}
-
track_dependency_files (name);
lex_push_file (ldlex_input_stack, name, sysrooted);
@@ -729,6 +728,34 @@ ldfile_open_command_file (const char *name)
ldfile_open_command_file_1 (name, script_nonT);
}
+void
+ldfile_open_chip_file (const char *name)
+{
+ char *fullname;
+ char *proj = getenv("PROJ_DIR");
+ if (proj != NULL)
+ {
+ ldfile_add_library_path(proj, false);
+ }
+ char *user = getenv("LD_USER_DIR");
+ if (user != NULL)
+ {
+ fullname = concat(user, slash, name , (const char *) NULL);
+ ldfile_add_library_path(fullname, false);
+ free(fullname);
+ }
+ char *vendor = getenv("LD_VENDOR_DIR");
+ if (vendor != NULL)
+ {
+ fullname = concat(vendor, slash, name , (const char *) NULL);
+ ldfile_add_library_path(fullname, false);
+ free(fullname);
+ }
+ fullname = concat(name, ".inc", (const char *) NULL);
+ ldfile_open_command_file_1 (fullname, script_nonT);
+ free(fullname);
+}
+
void
ldfile_open_script_file (const char *name)
{
diff --git a/ld/ldfile.h b/ld/ldfile.h
index defb550f76b..3b43e549928 100644
--- a/ld/ldfile.h
+++ b/ld/ldfile.h
@@ -46,6 +46,8 @@ extern void ldfile_add_library_path
(const char *, bool cmdline);
extern void ldfile_open_command_file
(const char *name);
+extern void ldfile_open_chip_file
+ (const char *name);
extern void ldfile_open_script_file
(const char *name);
extern void ldfile_open_default_command_file
--
2.34.1
next prev parent reply other threads:[~2023-03-14 22:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 22:01 [PATCH v1 0/3 CHIP: Support vendor script libraries binutils
2023-03-14 22:01 ` [PATCH v1 1/3] CHIP: ldlex.l binutils
2023-03-14 22:01 ` [PATCH v1 2/3] CHIP: ldgram.y binutils
2023-03-14 22:01 ` binutils [this message]
2023-03-14 22:06 ` [PATCH v1 0/3 CHIP: Support vendor script libraries Ulf Samuelsson
2023-03-15 16:27 ` Michael Matz
2023-03-15 20:03 ` Ulf Samuelsson
2023-03-16 8:23 ` Jan Beulich
2023-03-16 10:25 ` Ulf Samuelsson
2023-03-16 15:05 ` Michael Matz
2023-03-16 15:57 ` Ulf Samuelsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230314220114.1117782-4-binutils@emagii.com \
--to=binutils@emagii.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.com \
--cc=ulf@emagii.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).