提交 b96246c5 编写于 作者: C c00346986 提交者: public tcshversion

TicketNo:DTS2020080802733

Description:add a private flag to mark an elf file, and remove obsolete cached pages before writing on a elf file

Team:OTHERS
Feature or Bugfix:Bugfix
Binary Source:NA
PrivateCode(Yes/No):No

Change-Id: If3a17ac05c5035045704a0b66307165ab0076c34
Reviewed-on: http://mgit-tm.rnd.huawei.com/10334851Reviewed-by: Ncaoruihong 00546070 <crh.cao@huawei.com>
Reviewed-by: Nshenwei 00579521 <denny.shenwei@huawei.com>
Tested-by: Npublic jenkins <public_jenkins@notesmail.huawei.com>
上级 107d8412
......@@ -19,6 +19,8 @@
#define O_TMPFILE 020040000
#define O_NDELAY O_NONBLOCK
#define O_ELFFILE 040
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
......
......@@ -24,6 +24,8 @@
#define O_EXECVE 040000000
#define O_ELFFILE 040
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
......
......@@ -812,7 +812,7 @@ static int path_open(const char *name, const char *s, char *buf, size_t buf_size
l = strcspn(s, ":\n");
if (l-1 >= INT_MAX) return -1;
if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
if ((fd = open(buf, O_RDONLY))>=0) return fd; // open(buf, O_RDONLY|O_CLOEXEC)
if ((fd = open(buf, O_RDONLY | O_ELFFILE))>=0) return fd; // open(buf, O_RDONLY|O_CLOEXEC)
switch (errno) {
case ENOENT:
case ENOTDIR:
......@@ -1040,7 +1040,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by)
}
if (strchr(name, '/')) {
pathname = name;
fd = open(name, O_RDONLY); // open(name, O_RDONLY|O_CLOEXEC);
fd = open(name, O_RDONLY | O_ELFFILE); // open(name, O_RDONLY|O_CLOEXEC);
} else {
/* Search for the name to see if it's already loaded */
for (p=head->next; p; p=p->next) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册