History

Add rpath to the library paths instead of state->rpath

Riccardo Schirone committed 4 years ago

Commit 027b8fb1 parent d88857b2 files · +5 −10Browse files

Unified · Split

2 files
  1. libtcc.c +4 −9
  2. tccelf.c +1 −1
libtcc.c+4−9
@@ -1134,7 +1134,7 @@ LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname) · 1133 unmodified lines
11341134 }
11351135
11361136 static int tcc_add_library_internal(TCCState *s, const char *fmt,
1137− const char *filename, int flags, char **paths, int nb_paths, const char *rpath)
1137+ const char *filename, int flags, char **paths, int nb_paths)
11381138 {
11391139 char buf[1024];
11401140 int i;
@@ -1144,11 +1144,6 @@ static int tcc_add_library_internal(TCCState *s, const char *fmt, · 3 unmodified lines
11441144 if (tcc_add_file_internal(s, buf, flags | AFF_TYPE_BIN) == 0)
11451145 return 0;
11461146 }
1147− if (rpath) {
1148− snprintf(buf, sizeof(buf), fmt, rpath, filename);
1149− if (tcc_add_file_internal(s, buf, flags | AFF_TYPE_BIN) == 0)
1150− return 0;
1151− }
11521147 return -1;
11531148 }
11541149
@@ -1157,7 +1152,7 @@ static int tcc_add_library_internal(TCCState *s, const char *fmt, · 2 unmodified lines
11571152 ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags)
11581153 {
11591154 return tcc_add_library_internal(s, "%s/%s", filename, flags,
1160− s->library_paths, s->nb_library_paths, s->rpath);
1155+ s->library_paths, s->nb_library_paths);
11611156 }
11621157 #endif
11631158
@@ -1165,7 +1160,7 @@ ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags) · 1 unmodified line
11651160 ST_FUNC int tcc_add_crt(TCCState *s1, const char *filename)
11661161 {
11671162 if (-1 == tcc_add_library_internal(s1, "%s/%s",
1168− filename, 0, s1->crt_paths, s1->nb_crt_paths, NULL))
1163+ filename, 0, s1->crt_paths, s1->nb_crt_paths))
11691164 tcc_error_noabort("file '%s' not found", filename);
11701165 return 0;
11711166 }
@@ -1190,7 +1185,7 @@ LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname) · 18 unmodified lines
11901185 int flags = s->filetype & AFF_WHOLE_ARCHIVE;
11911186 while (*pp) {
11921187 if (0 == tcc_add_library_internal(s, *pp,
1193− libraryname, flags, s->library_paths, s->nb_library_paths, NULL))
1188+ libraryname, flags, s->library_paths, s->nb_library_paths))
11941189 return 0;
11951190 ++pp;
11961191 }
tccelf.c+1−1
@@ -3488,7 +3488,7 @@ ST_FUNC int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level) · 3487 unmodified lines
34883488 if (dt->d_tag == DT_SONAME) {
34893489 soname = dynstr + dt->d_un.d_val;
34903490 } else if (dt->d_tag == DT_RPATH) {
3491− s1->rpath = tcc_strdup(dynstr + dt->d_un.d_val);
3491+ tcc_add_library_path(s1, dynstr + dt->d_un.d_val);
34923492 }
34933493 }
34943494

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t