X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Femultempl%2Flinux.em;h=5a01155984ee8627afc930092542032dd609b06d;hb=00f93c449228e69f2161405b1f49b406e88785f0;hp=61c7df4e8bedd3ee6accb81a30400ebdcc0d72e2;hpb=66be105571d3494a28c0062f8bc663822121d838;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index 61c7df4e8b..5a01155984 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -9,8 +9,7 @@ fragment < Linux support by Eric Youngdale @@ -51,6 +50,8 @@ gld${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); input_flags.dynamic = TRUE; config.has_shared = TRUE; + link_info.check_relocs_after_open_input = TRUE; + link_info.relro = DEFAULT_LD_Z_RELRO; } /* Try to open a dynamic archive. This is where we know that Linux @@ -62,7 +63,7 @@ gld${EMULATION_NAME}_open_dynamic_archive { char *string; - if (! entry->flags.maybe_archive) + if (! entry->flags.maybe_archive || entry->flags.full_name_provided) return FALSE; string = (char *) xmalloc (strlen (search->name) @@ -115,14 +116,14 @@ gld${EMULATION_NAME}_create_output_section_statements (void) static void gld${EMULATION_NAME}_before_allocation (void) { - if (link_info.relocatable) + if (bfd_link_relocatable (&link_info)) return; /* Let the backend work out the sizes of any sections required by dynamic linking. */ if (! bfd_${EMULATION_NAME}_size_dynamic_sections (link_info.output_bfd, &link_info)) - einfo ("%P%F: failed to set dynamic section sizes: %E\n"); + einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); before_allocation_default (); } @@ -131,7 +132,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. @@ -142,11 +143,11 @@ fragment <> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (bfd_link_relocatable (&link_info)) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -163,9 +164,9 @@ fragment <