diff options
author | Yury Usishchev <y.usishchev@samsung.com> | 2015-02-09 20:24:33 +0300 |
---|---|---|
committer | Dongkyun Son <dongkyun.s@samsung.com> | 2015-06-02 23:48:32 -0700 |
commit | ca15d11e5aeb129c33aff377b8ca05df5f44c12d (patch) | |
tree | f092e945436f3d446664bc8cb2f0a6a7b3e305b5 | |
parent | 3bae4cbf94c3df80b261be6525abdbc8b44469d1 (diff) | |
download | binutils-ca15d11e5aeb129c33aff377b8ca05df5f44c12d.tar.gz binutils-ca15d11e5aeb129c33aff377b8ca05df5f44c12d.tar.bz2 binutils-ca15d11e5aeb129c33aff377b8ca05df5f44c12d.zip |
Revert "skip rpaths"submit/tizen/20150603.065700accepted/tizen/wearable/20150604.132828accepted/tizen/tv/20150604.132810accepted/tizen/mobile/20150604.132746accepted/tizen/common/20150604.131348
This reverts commit 56b35ae7eb9f225a2c357f3eff4aabd15eed5afe.
This commit introduced another dependency on environment variable
Change-Id: I1e116c374aed3c0de6f66c528de5b6cf87d2e330
Signed-off-by: Yury Usishchev <y.usishchev@samsung.com>
-rw-r--r-- | ld/emultempl/elf32.em | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 4f13c1c54cf..137446fe973 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1357,38 +1357,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation; else ELF_INTERPRETER_SET_DEFAULT= fi - - libpath_nl= - for path in $NATIVE_LIB_DIRS; do - libpath_nl="$libpath_nl\n$path" - done fragment <<EOF -static int -gld${EMULATION_NAME}_is_contained (const char *path, const char *dc) -{ - while (*dc) - { - const char *pc = path; - - while (*dc && *pc && *dc == *pc && *dc != '\n' - && *pc != ':' && *dc != '=') - { - dc++; - pc++; - } - if ((*pc == 0 || *pc == ':') && (*dc == '\n' || *dc == '=' || *dc == 0)) - return 1; - - while (*dc && *dc != '\n') - dc++; - if (*dc == '\n') - dc++; - } - - return 0; -} - /* used by before_allocation and handle_option. */ static void gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg) @@ -1435,7 +1405,7 @@ gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg) static void gld${EMULATION_NAME}_before_allocation (void) { - char *rpath; + const char *rpath; asection *sinterp; bfd *abfd; struct elf_link_hash_entry *ehdr_start = NULL; @@ -1487,65 +1457,7 @@ gld${EMULATION_NAME}_before_allocation (void) by dynamic linking. */ rpath = command_line.rpath; if (rpath == NULL) - rpath = getenv ("LD_RUN_PATH"); - - if (rpath != NULL && getenv ("SUSE_IGNORED_RPATHS")) - { - char *dirs = 0; - FILE *ldso = fopen (getenv ("SUSE_IGNORED_RPATHS"), "r"); - if (ldso) - { - off_t endcur = 0; - fseek (ldso, 0, SEEK_END); - endcur = ftell (ldso); - fseek (ldso, 0, SEEK_SET); - dirs = xmalloc (endcur); - if (fread (dirs, 1, endcur, ldso) != (size_t) endcur) - { - free (dirs); - dirs = NULL; - } - } - if (dirs) - { - char *cr; - rpath = xstrdup (rpath); - cr = rpath; /* cursor read */ - - while (*cr) - { - if (gld${EMULATION_NAME}_is_contained (cr, dirs) - || gld${EMULATION_NAME}_is_contained (cr, "$libpath_nl")) - { - char *cc = cr, *cw = cr; - while (*cc && *cc != ':') - cc++; - if (*cc == ':') - { - cc++; - for (; *cc; cc++, cw++) - *cw = *cc; - } - else if (cw > rpath) - cw[-1] = 0; - - *cw = 0; - } - else - { - while (*cr && *cr != ':') - cr++; - if (*cr == ':') - cr++; - } - } - if (*rpath == '\0') - { - free (rpath); - rpath = NULL; - } - } - } + rpath = (const char *) getenv ("LD_RUN_PATH"); for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) |