summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-10-20 15:40:03 +0000
committerMike Frysinger <vapier@gentoo.org>2004-10-20 15:40:03 +0000
commit64e3e23488a8fae7f781b707f0d30c85dfcde832 (patch)
treef54219de9ec0344d17fbe2761daa6f626962603b /sys-devel/binutils
parentftp->http in SRC_URI (Manifest recommit) (diff)
downloadgentoo-2-64e3e23488a8fae7f781b707f0d30c85dfcde832.tar.gz
gentoo-2-64e3e23488a8fae7f781b707f0d30c85dfcde832.tar.bz2
gentoo-2-64e3e23488a8fae7f781b707f0d30c85dfcde832.zip
old
Diffstat (limited to 'sys-devel/binutils')
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch11
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-array-sects-compat.patch20
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch475
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch113
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch15
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch34
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-sparc-nonpic.patch96
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch180
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch144
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-alpha-relax.patch23
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-array-sects-compat.patch20
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-compatsym.patch397
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-hdr.patch101
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-ro.patch475
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ld-r.patch24
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-libpath-suffix.patch43
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls1.patch1796
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls2.patch421
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-s390-noreladyn.patch24
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-searchdir.patch54
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sparc-nonpic.patch96
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sub-same.patch29
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.20-gas-mips-gprel.patch21
23 files changed, 0 insertions, 4612 deletions
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch
deleted file mode 100644
index 579e6f8e25a8..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- binutils-2.13.90.0.10/bfd/elfxx-ia64.c.ia64-brl 2002-09-27 17:33:09.000000000 +0200
-+++ binutils-2.13.90.0.10/bfd/elfxx-ia64.c 2002-11-15 15:17:17.000000000 +0100
-@@ -645,7 +645,7 @@ static const bfd_byte plt_full_entry[PLT
-
- /* Select out of range branch fixup type. Note that Itanium does
- not support brl, and so it gets emulated by the kernel. */
--#undef USE_BRL
-+#define USE_BRL
-
- static const bfd_byte oor_brl[16] =
- {
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-array-sects-compat.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-array-sects-compat.patch
deleted file mode 100644
index 2f2993ffe5b3..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-array-sects-compat.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- ld/scripttempl/elf.sc.array-sects-compat~ 2003-01-03 22:21:16.000000000 -0200
-+++ ld/scripttempl/elf.sc 2003-01-03 22:27:42.000000000 -0200
-@@ -288,6 +288,17 @@
- ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-
-+ /* For backward-compatibility with tools that don't support the
-+ *_array_* sections below, our glibc's crt files contain weak
-+ definitions of symbols that they reference. We don't want to use
-+ them, though, unless they're strictly necessary, because they'd
-+ bring us empty sections, unlike PROVIDE below, so we drop the
-+ sections from the crt files here. */
-+ /DISCARD/ : {
-+ */crti.o(.init_array .fini_array .preinit_array)
-+ */crtn.o(.init_array .fini_array .preinit_array)
-+ }
-+
- /* Ensure the __preinit_array_start label is properly aligned. We
- could instead move the label definition inside the section, but
- the linker would then create the section even if it turns out to
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch
deleted file mode 100644
index 51fa567e139c..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch
+++ /dev/null
@@ -1,475 +0,0 @@
-2002-11-22 Jakub Jelinek <jakub@redhat.com>
-
- * ldgram.y (sect_constraint): New.
- (ONLY_IF_RO, ONLY_IF_RW): New tokens.
- (section): Add sect_constraint. Pass additional argument
- to lang_enter_output_section_statement.
- * mri.c (mri_draw_tree): Pass additional argument to
- lang_enter_output_section_statement.
- * emultempl/pe.em (place_orphan): Likewise.
- (output_prev_sec_find): Disregard output section statements with
- constraint == -1.
- * emultempl/mmo.em (output_prev_sec_find): Likewise.
- (mmo_place_orphan): Pass additional argument to
- lang_enter_output_section_statement.
- * emultempl/elf32.em (output_prev_sec_find): Disregard output section
- statements with constraint == -1.
- (place_orphan): Pass additional argument to
- lang_enter_output_section_statement.
- * ldlang.c (lang_enter_overlay_section): Likewise.
- (lang_output_section_find_1): New.
- (lang_output_section_find): Use it.
- (lang_output_section_statement_lookup_1): New.
- (lang_output_section_statement_lookup): Use it.
- (check_section_callback, check_input_sections): New.
- (map_input_to_output_sections): Check if all input sections
- are readonly if ONLY_IF_RO or ONLY_IF_RW was seen.
- (strip_excluded_output_sections): Disregard output section statements
- with constraint == -1.
- (lang_record_phdrs): Likewise.
- (lang_enter_output_section_statement): Add constraint argument.
- Use lang_output_section_statement_lookup_1.
- * ldlang.h (lang_output_section_statement_type): Add constraint
- and all_input_readonly fields.
- (lang_enter_output_section_statement): Adjust prototype.
- * ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens.
- * scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text
- segment if all input sections are readonly.
-
---- ld/ldgram.y.jj 2002-10-14 13:30:34.000000000 +0200
-+++ ld/ldgram.y 2002-11-22 22:27:18.000000000 +0100
-@@ -143,14 +143,14 @@ static int error_index;
- %token ORIGIN FILL
- %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
- %token ALIGNMOD AT PROVIDE
--%type <token> assign_op atype attributes_opt
-+%type <token> assign_op atype attributes_opt sect_constraint
- %type <name> filename
- %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
- %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
- %token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
- %token <name> VERS_TAG VERS_IDENTIFIER
- %token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
--%token KEEP
-+%token KEEP ONLY_IF_RO ONLY_IF_RW
- %token EXCLUDE_FILE
- %type <versyms> vers_defns
- %type <versnode> vers_tag
-@@ -828,21 +828,28 @@ opt_at:
- | { $$ = 0; }
- ;
-
-+sect_constraint:
-+ ONLY_IF_RO { $$ = ONLY_IF_RO; }
-+ | ONLY_IF_RW { $$ = ONLY_IF_RW; }
-+ | { $$ = 0; }
-+ ;
-+
- section: NAME { ldlex_expression(); }
- opt_exp_with_type
- opt_at { ldlex_popstate (); ldlex_script (); }
-+ sect_constraint
- '{'
- {
- lang_enter_output_section_statement($1, $3,
- sectype,
-- 0, 0, 0, $4);
-+ 0, 0, 0, $4, $6);
- }
- statement_list_opt
- '}' { ldlex_popstate (); ldlex_expression (); }
- memspec_opt memspec_at_opt phdr_opt fill_opt
- {
- ldlex_popstate ();
-- lang_leave_output_section_statement ($14, $11, $13, $12);
-+ lang_leave_output_section_statement ($15, $12, $14, $13);
- }
- opt_comma
- {}
---- ld/mri.c.jj 2002-10-31 19:10:42.000000000 +0100
-+++ ld/mri.c 2002-11-22 18:38:27.000000000 +0100
-@@ -237,7 +237,7 @@ mri_draw_tree ()
- lang_enter_output_section_statement (p->name, base,
- p->ok_to_load ? 0 : noload_section,
- 1, align, subalign,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
- base = 0;
- tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
- tmp->next = NULL;
---- ld/emultempl/mmo.em.jj 2002-07-30 16:20:15.000000000 +0200
-+++ ld/emultempl/mmo.em 2002-11-22 22:42:44.000000000 +0100
-@@ -56,6 +56,8 @@ output_prev_sec_find (os)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-+ if (lookup->constraint == -1)
-+ continue;
- if (lookup == os)
- break;
- if (lookup->bfd_section != NULL
-@@ -141,7 +143,7 @@ mmo_place_orphan (file, s)
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
-
- lang_add_section (&os->children, s, os, file);
-
---- ld/emultempl/pe.em.jj 2002-11-21 15:58:51.000000000 +0100
-+++ ld/emultempl/pe.em 2002-11-22 22:43:02.000000000 +0100
-@@ -1489,6 +1489,8 @@ output_prev_sec_find (os)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-+ if (lookup->constraint == -1)
-+ continue;
- if (lookup == os)
- return s;
-
-@@ -1655,7 +1657,7 @@ gld_${EMULATION_NAME}_place_orphan (file
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
-
- lang_add_section (&add_child, s, os, file);
-
---- ld/emultempl/elf32.em.jj 2002-10-31 19:10:44.000000000 +0100
-+++ ld/emultempl/elf32.em 2002-11-22 22:42:16.000000000 +0100
-@@ -1009,7 +1009,8 @@ output_rel_find (sec)
- for (u = lang_output_section_statement.head; u; u = lookup->next)
- {
- lookup = &u->output_section_statement;
-- if (strncmp (".rel", lookup->name, 4) == 0)
-+ if (lookup->constraint != -1
-+ && strncmp (".rel", lookup->name, 4) == 0)
- {
- /* Don't place after .rel.plt as doing so results in wrong
- dynamic tags. Also, place allocated reloc sections before
-@@ -1236,7 +1237,7 @@ gld${EMULATION_NAME}_place_orphan (file,
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
-
- lang_add_section (&os->children, s, os, file);
-
---- ld/scripttempl/elf.sc.jj 2002-09-25 11:21:42.000000000 +0200
-+++ ld/scripttempl/elf.sc 2002-11-22 22:35:47.000000000 +0100
-@@ -280,6 +280,8 @@ cat <<EOF
- ${CREATE_SHLIB-${SBSS2}}
- ${OTHER_READONLY_SECTIONS}
- .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table) }
-
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
-@@ -312,8 +314,8 @@ cat <<EOF
- .data1 ${RELOCATING-0} : { *(.data1) }
- .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
- .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
-- .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
-- .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table) }
- ${WRITABLE_RODATA+${RODATA}}
- ${OTHER_READWRITE_SECTIONS}
- ${TEXT_DYNAMIC-${DYNAMIC}}
---- ld/ldlang.h.jj 2002-10-10 00:53:07.000000000 +0200
-+++ ld/ldlang.h 2002-11-22 22:27:37.000000000 +0100
-@@ -132,6 +132,8 @@ typedef struct lang_output_section_state
-
- int subsection_alignment; /* alignment of components */
- int section_alignment; /* alignment of start of section */
-+ int constraint;
-+ boolean all_input_readonly;
-
- union etree_union *load_base;
-
-@@ -385,7 +387,7 @@ extern lang_output_section_statement_typ
- bfd_vma block_value,
- etree_type *align,
- etree_type *subalign,
-- etree_type *));
-+ etree_type *, int));
- extern void lang_final PARAMS ((void));
- extern void lang_process PARAMS ((void));
- extern void lang_section_start PARAMS ((const char *, union etree_union *));
---- ld/ldlang.c.jj 2002-11-14 14:06:22.000000000 +0100
-+++ ld/ldlang.c 2002-11-22 22:41:51.000000000 +0100
-@@ -71,6 +71,10 @@ static void lang_for_each_statement_work
- static lang_input_statement_type *new_afile
- PARAMS ((const char *, lang_input_file_enum_type, const char *, boolean));
- static lang_memory_region_type *lang_memory_default PARAMS ((asection *));
-+static lang_output_section_statement_type * lang_output_section_find_1
-+ PARAMS ((const char *, int));
-+static lang_output_section_statement_type *
-+ lang_output_section_statement_lookup_1 PARAMS ((const char *, int));
- static void lang_map_flags PARAMS ((flagword));
- static void init_os PARAMS ((lang_output_section_statement_type *));
- static void exp_init_os PARAMS ((etree_type *));
-@@ -86,6 +90,9 @@ static lang_statement_union_type *wild_s
- static void output_section_callback
- PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
- lang_input_statement_type *, PTR));
-+static void check_section_callback
-+ PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
-+ lang_input_statement_type *, PTR));
- static lang_input_statement_type *lookup_name PARAMS ((const char *));
- static boolean load_symbols
- PARAMS ((lang_input_statement_type *, lang_statement_list_type *));
-@@ -98,6 +105,9 @@ static void open_input_bfds PARAMS ((lan
- static void lang_reasonable_defaults PARAMS ((void));
- static void insert_undefined PARAMS ((const char *));
- static void lang_place_undefineds PARAMS ((void));
-+static void check_input_sections
-+ PARAMS ((lang_statement_union_type *,
-+ lang_output_section_statement_type *));
- static void map_input_to_output_sections
- PARAMS ((lang_statement_union_type *, const char *,
- lang_output_section_statement_type *));
-@@ -700,9 +710,10 @@ lang_memory_default (section)
- return lang_memory_region_lookup ("*default*");
- }
-
--lang_output_section_statement_type *
--lang_output_section_find (name)
-+static lang_output_section_statement_type *
-+lang_output_section_find_1 (name, constraint)
- const char *const name;
-+ int constraint;
- {
- lang_statement_union_type *u;
- lang_output_section_statement_type *lookup;
-@@ -712,7 +723,9 @@ lang_output_section_find (name)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-- if (strcmp (name, lookup->name) == 0)
-+ if (strcmp (name, lookup->name) == 0
-+ && lookup->constraint != -1
-+ && (constraint == 0 || constraint == lookup->constraint))
- {
- return lookup;
- }
-@@ -721,12 +734,20 @@ lang_output_section_find (name)
- }
-
- lang_output_section_statement_type *
--lang_output_section_statement_lookup (name)
-+lang_output_section_find (name)
-+ const char *const name;
-+{
-+ return lang_output_section_find_1 (name, 0);
-+}
-+
-+static lang_output_section_statement_type *
-+lang_output_section_statement_lookup_1 (name, constraint)
- const char *const name;
-+ int constraint;
- {
- lang_output_section_statement_type *lookup;
-
-- lookup = lang_output_section_find (name);
-+ lookup = lang_output_section_find_1 (name, constraint);
- if (lookup == (lang_output_section_statement_type *) NULL)
- {
-
-@@ -741,6 +762,7 @@ lang_output_section_statement_lookup (na
- lookup->next = (lang_statement_union_type *) NULL;
- lookup->bfd_section = (asection *) NULL;
- lookup->processed = false;
-+ lookup->constraint = constraint;
- lookup->sectype = normal_section;
- lookup->addr_tree = (etree_type *) NULL;
- lang_list_init (&lookup->children);
-@@ -760,6 +782,13 @@ lang_output_section_statement_lookup (na
- return lookup;
- }
-
-+lang_output_section_statement_type *
-+lang_output_section_statement_lookup (name)
-+ const char *const name;
-+{
-+ return lang_output_section_statement_lookup_1 (name, 0);
-+}
-+
- static void
- lang_map_flags (flag)
- flagword flag;
-@@ -1434,6 +1463,31 @@ output_section_callback (ptr, sec, secti
- }
- }
-
-+/* Check if all sections in a wild statement for a particular FILE
-+ are readonly. */
-+
-+static void
-+check_section_callback (ptr, sec, section, file, output)
-+ lang_wild_statement_type *ptr ATTRIBUTE_UNUSED;
-+ struct wildcard_list *sec ATTRIBUTE_UNUSED;
-+ asection *section;
-+ lang_input_statement_type *file ATTRIBUTE_UNUSED;
-+ PTR output;
-+{
-+ /* Exclude sections that match UNIQUE_SECTION_LIST. */
-+ if (unique_section_p (bfd_get_section_name (file->the_bfd, section)))
-+ return;
-+
-+ if (section->output_section == NULL)
-+ {
-+ flagword flags = bfd_get_section_flags (section->owner, section);
-+
-+ if ((flags & SEC_READONLY) == 0)
-+ ((lang_output_section_statement_type *) output)->all_input_readonly
-+ = false;
-+ }
-+}
-+
- /* This is passed a file name which must have been seen already and
- added to the statement tree. We will see if it has been opened
- already and had its symbols read. If not then we'll read it. */
-@@ -2099,6 +2153,41 @@ lang_place_undefineds ()
- }
- }
-
-+/* Check for all readonly or some readwrite sections. */
-+
-+static void
-+check_input_sections (s, output_section_statement)
-+ lang_statement_union_type *s;
-+ lang_output_section_statement_type *output_section_statement;
-+{
-+ for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
-+ {
-+ switch (s->header.type)
-+ {
-+ case lang_wild_statement_enum:
-+ walk_wild (&s->wild_statement, check_section_callback,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ case lang_constructors_statement_enum:
-+ check_input_sections (constructor_list.head,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ case lang_group_statement_enum:
-+ check_input_sections (s->group_statement.children.head,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ default:
-+ break;
-+ }
-+ }
-+}
-+
- /* Open input files and attatch to output sections. */
-
- static void
-@@ -2120,6 +2209,23 @@ map_input_to_output_sections (s, target,
- output_section_statement);
- break;
- case lang_output_section_statement_enum:
-+ if (s->output_section_statement.constraint)
-+ {
-+ if (s->output_section_statement.constraint == -1)
-+ break;
-+ s->output_section_statement.all_input_readonly = true;
-+ check_input_sections (s->output_section_statement.children.head,
-+ &s->output_section_statement);
-+ if ((s->output_section_statement.all_input_readonly
-+ && s->output_section_statement.constraint == ONLY_IF_RW)
-+ || (!s->output_section_statement.all_input_readonly
-+ && s->output_section_statement.constraint == ONLY_IF_RO))
-+ {
-+ s->output_section_statement.constraint = -1;
-+ break;
-+ }
-+ }
-+
- map_input_to_output_sections (s->output_section_statement.children.head,
- target,
- &s->output_section_statement);
-@@ -2190,6 +2296,8 @@ strip_excluded_output_sections ()
- asection *s;
-
- os = &u->output_section_statement;
-+ if (os->constraint == -1)
-+ continue;
- s = os->bfd_section;
- if (s != NULL && (s->flags & SEC_EXCLUDE) != 0)
- {
-@@ -4056,7 +4164,7 @@ topower (x)
- lang_output_section_statement_type *
- lang_enter_output_section_statement (output_section_statement_name,
- address_exp, sectype, block_value,
-- align, subalign, ebase)
-+ align, subalign, ebase, constraint)
- const char *output_section_statement_name;
- etree_type *address_exp;
- enum section_type sectype;
-@@ -4064,12 +4172,14 @@ lang_enter_output_section_statement (out
- etree_type *align;
- etree_type *subalign;
- etree_type *ebase;
-+ int constraint;
- {
- lang_output_section_statement_type *os;
-
- current_section =
- os =
-- lang_output_section_statement_lookup (output_section_statement_name);
-+ lang_output_section_statement_lookup_1 (output_section_statement_name,
-+ constraint);
-
- /* Add this statement to tree. */
- #if 0
-@@ -4784,6 +4894,8 @@ lang_record_phdrs ()
- struct lang_output_section_phdr_list *pl;
-
- os = &u->output_section_statement;
-+ if (os->constraint == -1)
-+ continue;
-
- pl = os->phdrs;
- if (pl != NULL)
-@@ -4844,7 +4956,8 @@ lang_record_phdrs ()
- {
- struct lang_output_section_phdr_list *pl;
-
-- if (u->output_section_statement.bfd_section == NULL)
-+ if (u->output_section_statement.constraint == -1
-+ || u->output_section_statement.bfd_section == NULL)
- continue;
-
- for (pl = u->output_section_statement.phdrs;
-@@ -4914,7 +5027,7 @@ lang_enter_overlay_section (name)
- etree_type *size;
-
- lang_enter_output_section_statement (name, overlay_vma, normal_section,
-- 0, 0, 0, 0);
-+ 0, 0, 0, 0, 0);
-
- /* If this is the first section, then base the VMA of future
- sections on this one. This will work correctly even if `.' is
---- ld/ldlex.l.jj 2002-10-31 19:10:42.000000000 +0100
-+++ ld/ldlex.l 2002-11-22 17:29:14.000000000 +0100
-@@ -303,6 +303,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?
- <EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
- <EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
- <EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
-+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); }
-+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); }
- <BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
- <BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
- <BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch
deleted file mode 100644
index 6266ec60f04d..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-2002-11-29 Jakub Jelinek <jakub@redhat.com>
-
- * elfxx-ia64.c (elfNN_ia64_obj_tdata): New struct.
- (elfNN_ia64_tdata): New macro.
- (elfNN_ia64_mkobject, elfNN_ia64_object_p): New functions.
- (get_local_sym_hash): Assign keys to input bfds instead of using
- their pointer addresses for hashing purposes.
- (bfd_elfNN_mkobject, elf_backend_object_p): Define.
-
---- bfd/elfxx-ia64.c.jj 2002-11-28 15:49:52.000000000 +0100
-+++ bfd/elfxx-ia64.c 2002-11-29 01:38:39.000000000 +0100
-@@ -152,6 +152,15 @@ struct elfNN_ia64_link_hash_table
- struct elfNN_ia64_local_hash_table loc_hash_table;
- };
-
-+struct elfNN_ia64_obj_tdata
-+{
-+ struct elf_obj_tdata root;
-+ unsigned long key;
-+};
-+
-+#define elfNN_ia64_tdata(abfd) \
-+ ((struct elfNN_ia64_obj_tdata *) (abfd)->tdata.any)
-+
- #define elfNN_ia64_hash_table(p) \
- ((struct elfNN_ia64_link_hash_table *) ((p)->hash))
-
-@@ -317,6 +326,8 @@ static boolean elfNN_ia64_print_private_
- PARAMS ((bfd *abfd, PTR ptr));
- static enum elf_reloc_type_class elfNN_ia64_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
-+static boolean elfNN_ia64_mkobject PARAMS ((bfd *));
-+static boolean elfNN_ia64_object_p PARAMS ((bfd *));
- static boolean elfNN_ia64_hpux_vec
- PARAMS ((const bfd_target *vec));
- static void elfNN_hpux_post_process_headers
-@@ -1834,26 +1845,22 @@ get_local_sym_hash (ia64_info, abfd, rel
- const Elf_Internal_Rela *rel;
- boolean create;
- {
-- char *addr_name;
-- size_t len;
-+ char *addr_name [2 * sizeof (unsigned long) + 2];
- struct elfNN_ia64_local_hash_entry *ret;
-+ static unsigned long key;
-+
-+ if (! elfNN_ia64_tdata (abfd)->key)
-+ elfNN_ia64_tdata (abfd)->key = ++key;
-
- /* Construct a string for use in the elfNN_ia64_local_hash_table.
- name describes what was once anonymous memory. */
-
-- len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
-- len += 10; /* %p slop */
--
-- addr_name = bfd_malloc (len);
-- if (addr_name == NULL)
-- return 0;
-- sprintf (addr_name, "%p:%lx",
-- (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info));
-+ sprintf (addr_name, "%lx:%lx", elfNN_ia64_tdata (abfd)->key,
-+ (unsigned long) ELFNN_R_SYM (rel->r_info));
-
- /* Collect the canonical entry data for this address. */
- ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
- addr_name, create, create);
-- free (addr_name);
- return ret;
- }
-
-@@ -4660,6 +4667,32 @@ elfNN_ia64_reloc_type_class (rela)
- }
-
- static boolean
-+elfNN_ia64_mkobject (abfd)
-+ bfd *abfd;
-+{
-+ bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
-+ abfd->tdata.any = bfd_zalloc (abfd, amt);
-+ if (abfd->tdata.any == NULL)
-+ return false;
-+ return true;
-+}
-+
-+static boolean
-+elfNN_ia64_object_p (abfd)
-+ bfd *abfd;
-+{
-+ /* Allocate our special target data. */
-+ struct elfNN_ia64_obj_tdata *new_tdata;
-+ bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
-+ new_tdata = bfd_zalloc (abfd, amt);
-+ if (new_tdata == NULL)
-+ return false;
-+ new_tdata->root = *abfd->tdata.elf_obj_data;
-+ abfd->tdata.any = new_tdata;
-+ return true;
-+}
-+
-+static boolean
- elfNN_ia64_hpux_vec (const bfd_target *vec)
- {
- extern const bfd_target bfd_elfNN_ia64_hpux_big_vec;
-@@ -4718,6 +4751,9 @@ elfNN_hpux_backend_section_from_bfd_sect
- #define elf_info_to_howto \
- elfNN_ia64_info_to_howto
-
-+#define bfd_elfNN_mkobject elfNN_ia64_mkobject
-+#define elf_backend_object_p elfNN_ia64_object_p
-+
- #define bfd_elfNN_bfd_reloc_type_lookup \
- elfNN_ia64_reloc_type_lookup
- #define bfd_elfNN_bfd_is_local_label_name \
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch
deleted file mode 100644
index 14ae4c50c697..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-2002-11-27 Jakub Jelinek <jakub@redhat.com>
-
- * config/tc-ppc.c (ppc_cleanup): Remove SEC_MERGE.
-
---- gas/config/tc-ppc.c.jj Fri Sep 27 11:33:09 2002
-+++ gas/config/tc-ppc.c Wed Nov 27 11:37:13 2002
-@@ -1329,7 +1329,7 @@ ppc_cleanup ()
- apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0);
- bfd_set_section_flags (stdoutput,
- apuinfo_secp,
-- SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
-+ SEC_HAS_CONTENTS | SEC_READONLY);
-
- p = frag_more (4);
- md_number_to_chars (p, (valueT) 8, 4);
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch
deleted file mode 100644
index e3931a2b19e7..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2002-11-24 Jakub Jelinek <jakub@redhat.com>
-
- * write.c (subsegs_finish): For SEC_MERGE sections pad last fragment
- to entsize.
-
---- gas/write.c.jj 2002-11-21 15:58:39.000000000 +0100
-+++ gas/write.c 2002-11-24 23:54:58.000000000 +0100
-@@ -1409,7 +1409,25 @@ subsegs_finish ()
- any alignment is meaningless, and, moreover, will look weird
- if we are generating a listing. */
- if (!had_errors ())
-- alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
-+ {
-+ alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
-+#ifdef BFD_ASSEMBLER
-+ if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
-+ && now_seg->entsize)
-+ {
-+ unsigned int entsize = now_seg->entsize;
-+ int entalign = 0;
-+
-+ while ((entsize & 1) == 0)
-+ {
-+ ++entalign;
-+ entsize >>= 1;
-+ }
-+ if (entalign > alignment)
-+ alignment = entalign;
-+ }
-+#endif
-+ }
-
- if (subseg_text_p (now_seg))
- frag_align_code (alignment, 0);
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-sparc-nonpic.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-sparc-nonpic.patch
deleted file mode 100644
index 2639a82e92fe..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-sparc-nonpic.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-2002-04-20 Jakub Jelinek <jakub@redhat.com>
-
- * elf32-sparc.c (elf32_sparc_relocate_section): Find real output
- section with SEC_MERGE.
- * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
-
---- bfd/elf32-sparc.c.jj Sat Apr 20 22:11:57 2002
-+++ bfd/elf32-sparc.c Sat Apr 20 23:06:33 2002
-@@ -1144,7 +1144,7 @@ elf32_sparc_relocate_section (output_bfd
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sec;
-- bfd_vma relocation, off;
-+ bfd_vma relocation, off, orig_addend = 0;
- bfd_reloc_status_type r;
- boolean is_plt = false;
- boolean unresolved_reloc;
-@@ -1192,6 +1192,7 @@ elf32_sparc_relocate_section (output_bfd
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
-+ orig_addend = rel->r_addend;
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
- }
- else
-@@ -1527,6 +1528,25 @@ elf32_sparc_relocate_section (output_bfd
- asection *osec;
-
- osec = sec->output_section;
-+ /* FIXME: As soon as making sections zero size
-+ is possible, this if can go away. */
-+ if (bfd_is_abs_section (osec)
-+ && h == NULL
-+ && (sec->flags & SEC_MERGE)
-+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-+ && (elf_section_data (sec)->sec_info_type
-+ == ELF_INFO_TYPE_MERGE))
-+ {
-+ asection *msec;
-+
-+ msec = sec;
-+ _bfd_merged_section_offset (output_bfd, &msec,
-+ elf_section_data (sec)->sec_info,
-+ sym->st_value + orig_addend,
-+ (bfd_vma) 0);
-+ osec = msec->output_section;
-+ }
-+
- indx = elf_section_data (osec)->dynindx;
-
- /* FIXME: we really should be able to link non-pic
---- bfd/elf64-sparc.c.jj Sat Apr 20 22:11:57 2002
-+++ bfd/elf64-sparc.c Sat Apr 20 23:12:18 2002
-@@ -1939,7 +1939,7 @@ sparc64_elf_relocate_section (output_bfd
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sec;
-- bfd_vma relocation, off;
-+ bfd_vma relocation, off, orig_addend = 0;
- bfd_reloc_status_type r;
- boolean is_plt = false;
- boolean unresolved_reloc;
-@@ -1982,6 +1982,7 @@ sparc64_elf_relocate_section (output_bfd
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
-+ orig_addend = rel->r_addend;
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
- }
- else
-@@ -2211,6 +2212,25 @@ sparc64_elf_relocate_section (output_bfd
- asection *osec;
-
- osec = sec->output_section;
-+ /* FIXME: As soon as making sections zero size
-+ is possible, this if can go away. */
-+ if (bfd_is_abs_section (osec)
-+ && h == NULL
-+ && (sec->flags & SEC_MERGE)
-+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-+ && (elf_section_data (sec)->sec_info_type
-+ == ELF_INFO_TYPE_MERGE))
-+ {
-+ asection *msec;
-+
-+ msec = sec;
-+ _bfd_merged_section_offset (output_bfd, &msec,
-+ elf_section_data (sec)->sec_info,
-+ sym->st_value + orig_addend,
-+ (bfd_vma) 0);
-+ osec = msec->output_section;
-+ }
-+
- indx = elf_section_data (osec)->dynindx;
-
- /* FIXME: we really should be able to link non-pic
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch
deleted file mode 100644
index 6623d288cbfe..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-2002-11-29 Jakub Jelinek <jakub@redhat.com>
-
- * config/tc-ia64.c (md_apply_fix3): Add default case.
-
-2002-11-28 Jakub Jelinek <jakub@redhat.com>
-
- * symbols.c (S_SET_THREAD_LOCAL): New function.
- * symbols.h (S_SET_THREAD_LOCAL): New prototype.
- * config/tc-i386.c (md_apply_fix3): Call S_SET_THREAD_LOCAL
- for TLS relocations.
- * config/tc-ia64.c (md_apply_fix3): Likewise.
- * config/tc-alpha.c (md_apply_fix3): Likewise.
-
- * ld-i386/tlsnopic.rd: Change NOTYPE to TLS for UND sg* symbols.
-
---- gas/config/tc-i386.c.jj 2002-10-14 13:30:31.000000000 +0200
-+++ gas/config/tc-i386.c 2002-11-14 15:11:07.000000000 +0100
-@@ -4679,17 +4679,27 @@ md_apply_fix3 (fixP, valP, seg)
- value = -4;
- break;
-
-- case BFD_RELOC_386_GOT32:
- case BFD_RELOC_386_TLS_GD:
- case BFD_RELOC_386_TLS_LDM:
- case BFD_RELOC_386_TLS_IE_32:
- case BFD_RELOC_386_TLS_IE:
- case BFD_RELOC_386_TLS_GOTIE:
-- case BFD_RELOC_X86_64_GOT32:
- case BFD_RELOC_X86_64_TLSGD:
- case BFD_RELOC_X86_64_TLSLD:
- case BFD_RELOC_X86_64_GOTTPOFF:
- value = 0; /* Fully resolved at runtime. No addend. */
-+ /* Fallthrough */
-+ case BFD_RELOC_386_TLS_LE:
-+ case BFD_RELOC_386_TLS_LDO_32:
-+ case BFD_RELOC_386_TLS_LE_32:
-+ case BFD_RELOC_X86_64_DTPOFF32:
-+ case BFD_RELOC_X86_64_TPOFF32:
-+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
-+ break;
-+
-+ case BFD_RELOC_386_GOT32:
-+ case BFD_RELOC_X86_64_GOT32:
-+ value = 0; /* Fully resolved at runtime. No addend. */
- break;
-
- case BFD_RELOC_VTABLE_INHERIT:
---- gas/config/tc-ia64.c.jj 2002-09-10 14:50:57.000000000 +0200
-+++ gas/config/tc-ia64.c 2002-11-19 13:28:47.000000000 +0100
-@@ -10413,8 +10413,9 @@ md_apply_fix3 (fix, valP, seg)
- }
- if (fix->fx_addsy)
- {
-- if (fix->fx_r_type == (int) BFD_RELOC_UNUSED)
-+ switch (fix->fx_r_type)
- {
-+ case BFD_RELOC_UNUSED:
- /* This must be a TAG13 or TAG13b operand. There are no external
- relocs defined for them, so we must give an error. */
- as_bad_where (fix->fx_file, fix->fx_line,
-@@ -10422,6 +10423,21 @@ md_apply_fix3 (fix, valP, seg)
- elf64_ia64_operands[fix->tc_fix_data.opnd].desc);
- fix->fx_done = 1;
- return;
-+
-+ case BFD_RELOC_IA64_TPREL14:
-+ case BFD_RELOC_IA64_TPREL22:
-+ case BFD_RELOC_IA64_TPREL64I:
-+ case BFD_RELOC_IA64_LTOFF_TPREL22:
-+ case BFD_RELOC_IA64_LTOFF_DTPMOD22:
-+ case BFD_RELOC_IA64_DTPREL14:
-+ case BFD_RELOC_IA64_DTPREL22:
-+ case BFD_RELOC_IA64_DTPREL64I:
-+ case BFD_RELOC_IA64_LTOFF_DTPREL22:
-+ S_SET_THREAD_LOCAL (fix->fx_addsy);
-+ break;
-+
-+ default:
-+ break;
- }
-
- /* ??? This is a hack copied from tc-i386.c to make PCREL relocs
---- gas/config/tc-alpha.c.jj 2002-11-14 14:04:42.000000000 +0100
-+++ gas/config/tc-alpha.c 2002-11-19 16:14:03.000000000 +0100
-@@ -1261,6 +1261,8 @@ md_apply_fix3 (fixP, valP, seg)
-
- #ifdef OBJ_ELF
- case BFD_RELOC_ALPHA_BRSGP:
-+ return;
-+
- case BFD_RELOC_ALPHA_TLSGD:
- case BFD_RELOC_ALPHA_TLSLDM:
- case BFD_RELOC_ALPHA_GOTDTPREL16:
-@@ -1271,6 +1273,8 @@ md_apply_fix3 (fixP, valP, seg)
- case BFD_RELOC_ALPHA_TPREL_HI16:
- case BFD_RELOC_ALPHA_TPREL_LO16:
- case BFD_RELOC_ALPHA_TPREL16:
-+ if (fixP->fx_addsy)
-+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
- return;
- #endif
-
---- gas/symbols.h.jj 2002-09-10 14:50:53.000000000 +0200
-+++ gas/symbols.h 2002-11-14 14:26:10.000000000 +0100
-@@ -102,6 +102,7 @@ extern void S_SET_EXTERNAL PARAMS ((symb
- extern void S_SET_NAME PARAMS ((symbolS *, char *));
- extern void S_CLEAR_EXTERNAL PARAMS ((symbolS *));
- extern void S_SET_WEAK PARAMS ((symbolS *));
-+extern void S_SET_THREAD_LOCAL PARAMS ((symbolS *));
- #endif
-
- #ifndef WORKING_DOT_WORD
---- gas/symbols.c.jj 2002-09-21 23:44:50.000000000 +0200
-+++ gas/symbols.c 2002-11-19 13:02:03.000000000 +0100
-@@ -1951,6 +1951,25 @@ S_SET_WEAK (s)
- }
-
- void
-+S_SET_THREAD_LOCAL (s)
-+ symbolS *s;
-+{
-+ if (LOCAL_SYMBOL_CHECK (s))
-+ s = local_symbol_convert ((struct local_symbol *) s);
-+ if (bfd_is_com_section (s->bsym->section)
-+ && (s->bsym->flags & BSF_THREAD_LOCAL) != 0)
-+ return;
-+ s->bsym->flags |= BSF_THREAD_LOCAL;
-+ if ((s->bsym->flags & BSF_FUNCTION) != 0)
-+ as_bad (_("Accessing function `%s' as thread-local object"),
-+ S_GET_NAME (s));
-+ else if (! bfd_is_und_section (s->bsym->section)
-+ && (s->bsym->section->flags & SEC_THREAD_LOCAL) == 0)
-+ as_bad (_("Accessing `%s' as thread-local object"),
-+ S_GET_NAME (s));
-+}
-+
-+void
- S_SET_NAME (s, name)
- symbolS *s;
- char *name;
---- ld/testsuite/ld-i386/tlsnopic.rd.jj 2002-09-19 12:01:19.000000000 +0200
-+++ ld/testsuite/ld-i386/tlsnopic.rd 2002-11-14 15:07:13.000000000 +0100
-@@ -84,13 +84,13 @@ Symbol table '.dynsym' contains 22 entri
- +9: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +10 *
- +11: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _DYNAMIC
-- +12: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg3
-- +13: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg4
-+ +12: 0+ +0 TLS +GLOBAL DEFAULT UND sg3
-+ +13: 0+ +0 TLS +GLOBAL DEFAULT UND sg4
- +14: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
-- +15: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg5
-- +16: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg1
-+ +15: 0+ +0 TLS +GLOBAL DEFAULT UND sg5
-+ +16: 0+ +0 TLS +GLOBAL DEFAULT UND sg1
- +17: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
-- +18: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg2
-+ +18: 0+ +0 TLS +GLOBAL DEFAULT UND sg2
- +19: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +20: 0+2080 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
- +21: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
-@@ -121,13 +121,13 @@ Symbol table '.symtab' contains 34 entri
- +21: 0+14 +0 TLS +LOCAL HIDDEN +7 sh1
- +22: 0+18 +0 TLS +LOCAL HIDDEN +7 sh2
- +23: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _DYNAMIC
-- +24: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg3
-- +25: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg4
-+ +24: 0+ +0 TLS +GLOBAL DEFAULT UND sg3
-+ +25: 0+ +0 TLS +GLOBAL DEFAULT UND sg4
- +26: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
-- +27: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg5
-- +28: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg1
-+ +27: 0+ +0 TLS +GLOBAL DEFAULT UND sg5
-+ +28: 0+ +0 TLS +GLOBAL DEFAULT UND sg1
- +29: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
-- +30: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg2
-+ +30: 0+ +0 TLS +GLOBAL DEFAULT UND sg2
- +31: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +32: 0+2080 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
- +33: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch
deleted file mode 100644
index 3a7b50a5562e..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-2002-11-30 Jakub Jelinek <jakub@redhat.com>
-
- * elf.c (elf_sort_sections): Don't reorder .tbss.
- (assign_file_positions_for_segments): Only adjust off/voff
- for increased alignment in PT_LOAD or PT_NOTE segment,
- but adjust p_filesz for .tbss too. in PT_LOAD consider
- .tbss to have zero memory size.
- (copy_private_bfd_data) [SECTION_SIZE]: Define.
- [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
- [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
- into PT_TLS segment. Never put SHF_TLS sections in
- segments other than PT_TLS or PT_LOAD.
-
---- bfd/elf.c.jj 2002-11-28 15:49:48.000000000 +0100
-+++ bfd/elf.c 2002-11-29 23:58:06.000000000 +0100
-@@ -3494,6 +3494,7 @@ elf_sort_sections (arg1, arg2)
- {
- const asection *sec1 = *(const asection **) arg1;
- const asection *sec2 = *(const asection **) arg2;
-+ bfd_size_type size1, size2;
-
- /* Sort by LMA first, since this is the address used to
- place the section into a segment. */
-@@ -3511,7 +3512,7 @@ elf_sort_sections (arg1, arg2)
-
- /* Put !SEC_LOAD sections after SEC_LOAD ones. */
-
--#define TOEND(x) (((x)->flags & SEC_LOAD) == 0)
-+#define TOEND(x) (((x)->flags & (SEC_LOAD|SEC_THREAD_LOCAL)) == 0)
-
- if (TOEND (sec1))
- {
-@@ -3533,9 +3534,12 @@ elf_sort_sections (arg1, arg2)
- /* Sort by size, to put zero sized sections
- before others at the same address. */
-
-- if (sec1->_raw_size < sec2->_raw_size)
-+ size1 = (sec1->flags & SEC_LOAD) ? sec1->_raw_size : 0;
-+ size2 = (sec2->flags & SEC_LOAD) ? sec2->_raw_size : 0;
-+
-+ if (size1 < size2)
- return -1;
-- if (sec1->_raw_size > sec2->_raw_size)
-+ if (size1 > size2)
- return 1;
-
- return sec1->target_index - sec2->target_index;
-@@ -3816,9 +3820,15 @@ assign_file_positions_for_segments (abfd
- bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz);
-
- p->p_memsz += adjust;
-- off += adjust;
-- voff += adjust;
-- if ((flags & SEC_LOAD) != 0)
-+ if (p->p_type == PT_LOAD
-+ || (p->p_type == PT_NOTE
-+ && bfd_get_format (abfd) == bfd_core))
-+ {
-+ off += adjust;
-+ voff += adjust;
-+ }
-+ if ((flags & SEC_LOAD) != 0
-+ || (flags & SEC_THREAD_LOCAL) != 0)
- p->p_filesz += adjust;
- }
-
-@@ -3875,7 +3885,9 @@ Error: First section in segment (%s) sta
- || (flags & SEC_HAS_CONTENTS) != 0)
- off += sec->_raw_size;
-
-- if ((flags & SEC_ALLOC) != 0)
-+ if ((flags & SEC_ALLOC) != 0
-+ && ((flags & SEC_LOAD) != 0
-+ || (flags & SEC_THREAD_LOCAL) == 0))
- voff += sec->_raw_size;
- }
-
-@@ -3902,6 +3914,9 @@ Error: First section in segment (%s) sta
- }
- else
- {
-+ if ((sec->flags & SEC_LOAD) != 0
-+ || (sec->flags & SEC_THREAD_LOCAL) == 0
-+ || p->p_type == PT_TLS)
- p->p_memsz += sec->_raw_size;
-
- if ((flags & SEC_LOAD) != 0)
-@@ -4545,18 +4560,23 @@ copy_private_bfd_data (ibfd, obfd)
- (start + (segment->p_memsz > segment->p_filesz \
- ? segment->p_memsz : segment->p_filesz))
-
-+#define SECTION_SIZE(section, segment) \
-+ (((section->flags & (SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) \
-+ != SEC_THREAD_LOCAL || segment->p_type == PT_TLS) \
-+ ? section->_raw_size : 0)
-+
- /* Returns true if the given section is contained within
- the given segment. VMA addresses are compared. */
- #define IS_CONTAINED_BY_VMA(section, segment) \
- (section->vma >= segment->p_vaddr \
-- && (section->vma + section->_raw_size \
-+ && (section->vma + SECTION_SIZE (section, segment) \
- <= (SEGMENT_END (segment, segment->p_vaddr))))
-
- /* Returns true if the given section is contained within
- the given segment. LMA addresses are compared. */
- #define IS_CONTAINED_BY_LMA(section, segment, base) \
- (section->lma >= base \
-- && (section->lma + section->_raw_size \
-+ && (section->lma + SECTION_SIZE (section, segment) \
- <= SEGMENT_END (segment, base)))
-
- /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */
-@@ -4588,7 +4608,9 @@ copy_private_bfd_data (ibfd, obfd)
- if that is set for the segment and the VMA otherwise,
- 2. It is an allocated segment,
- 3. There is an output section associated with it,
-- 4. The section has not already been allocated to a previous segment. */
-+ 4. The section has not already been allocated to a previous segment.
-+ 5. PT_TLS segment includes only SHF_TLS sections.
-+ 6. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. */
- #define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \
- ((((segment->p_paddr \
- ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
-@@ -4596,6 +4618,11 @@ copy_private_bfd_data (ibfd, obfd)
- && (section->flags & SEC_ALLOC) != 0) \
- || IS_COREFILE_NOTE (segment, section)) \
- && section->output_section != NULL \
-+ && (segment->p_type != PT_TLS \
-+ || (section->flags & SEC_THREAD_LOCAL)) \
-+ && (segment->p_type == PT_LOAD \
-+ || segment->p_type == PT_TLS \
-+ || (section->flags & SEC_THREAD_LOCAL) == 0) \
- && ! section->segment_mark)
-
- /* Returns true iff seg1 starts after the end of seg2. */
-@@ -5073,6 +5100,7 @@ copy_private_bfd_data (ibfd, obfd)
- #endif
-
- #undef SEGMENT_END
-+#undef SECTION_SIZE
- #undef IS_CONTAINED_BY_VMA
- #undef IS_CONTAINED_BY_LMA
- #undef IS_COREFILE_NOTE
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-alpha-relax.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-alpha-relax.patch
deleted file mode 100644
index a9bd3bceffa0..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-alpha-relax.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-2003-02-06 Jakub Jelinek <jakub@redhat.com>
-
- * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
- local_got_entries is NULL.
-
---- bfd/elf64-alpha.c.jj 2003-02-06 10:53:56.000000000 -0500
-+++ bfd/elf64-alpha.c 2003-02-06 10:53:56.000000000 -0500
-@@ -2184,7 +2184,13 @@ elf64_alpha_relax_section (abfd, sec, li
-
- info.h = NULL;
- info.other = isym->st_other;
-- info.first_gotent = &local_got_entries[r_symndx];
-+ if (local_got_entries)
-+ info.first_gotent = &local_got_entries[r_symndx];
-+ else
-+ {
-+ info.first_gotent = &info.gotent;
-+ info.gotent = NULL;
-+ }
- }
- else
- {
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-array-sects-compat.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-array-sects-compat.patch
deleted file mode 100644
index 2f2993ffe5b3..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-array-sects-compat.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- ld/scripttempl/elf.sc.array-sects-compat~ 2003-01-03 22:21:16.000000000 -0200
-+++ ld/scripttempl/elf.sc 2003-01-03 22:27:42.000000000 -0200
-@@ -288,6 +288,17 @@
- ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
-
-+ /* For backward-compatibility with tools that don't support the
-+ *_array_* sections below, our glibc's crt files contain weak
-+ definitions of symbols that they reference. We don't want to use
-+ them, though, unless they're strictly necessary, because they'd
-+ bring us empty sections, unlike PROVIDE below, so we drop the
-+ sections from the crt files here. */
-+ /DISCARD/ : {
-+ */crti.o(.init_array .fini_array .preinit_array)
-+ */crtn.o(.init_array .fini_array .preinit_array)
-+ }
-+
- /* Ensure the __preinit_array_start label is properly aligned. We
- could instead move the label definition inside the section, but
- the linker would then create the section even if it turns out to
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-compatsym.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-compatsym.patch
deleted file mode 100644
index 447d208e6877..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-compatsym.patch
+++ /dev/null
@@ -1,397 +0,0 @@
-2003-02-10 Jakub Jelinek <jakub@redhat.com>
-
-bfd/
- * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
-ld/testsuite/
- * ld-shared/shared.exp: Run on s390*-*-linux* and x86_64-*-linux* too.
- xfail tests linking non-pic code into shared libs on x86_64-*-linux*.
- * ld-elfvsb/elfvsb.exp: Likewise.
- * ld-elfvers/vers.exp: Likewise. Add vers24a, vers24b and vers24c
- tests.
- * ld-elfvers/vers3.ver: Allow VERS_2.0 to come before GLIBC_*
- version.
- * ld-elfvers/vers19.ver: Likewise.
- * ld-elfvers/vers24a.c: New test.
- * ld-elfvers/vers24b.c: New test.
- * ld-elfvers/vers24c.c: New test.
- * ld-elfvers/vers24.map: New test.
- * ld-elfvers/vers24.rd: New test.
- * lib/ld-lib.exp (run_ld_link_tests): Add optional 7th argument
- cflags. If source files have .c extension, compile them first.
-
---- bfd/elflink.h.jj 2003-02-05 18:24:42.000000000 -0500
-+++ bfd/elflink.h 2003-02-10 10:42:05.000000000 -0500
-@@ -1168,6 +1168,8 @@ elf_link_add_object_symbols (abfd, info)
- Elf_External_Versym *extversym = NULL;
- Elf_External_Versym *ever;
- struct elf_link_hash_entry *weaks;
-+ struct elf_link_hash_entry **nondeflt_vers = NULL;
-+ bfd_size_type nondeflt_vers_cnt = 0;
- Elf_Internal_Sym *isymbuf = NULL;
- Elf_Internal_Sym *isym;
- Elf_Internal_Sym *isymend;
-@@ -1997,6 +1999,23 @@ elf_link_add_object_symbols (abfd, info)
- override, dt_needed))
- goto error_free_vers;
-
-+ if (definition && (abfd->flags & DYNAMIC) == 0)
-+ {
-+ char *p = strchr (name, ELF_VER_CHR);
-+ if (p != NULL && p[1] != ELF_VER_CHR)
-+ {
-+ /* Queue non-default versions so that .symver x, x@FOO
-+ aliases can be checked. */
-+ if (! nondeflt_vers)
-+ {
-+ amt = (isymend - isym + 1)
-+ * sizeof (struct elf_link_hash_entry *);
-+ nondeflt_vers = bfd_malloc (amt);
-+ }
-+ nondeflt_vers [nondeflt_vers_cnt++] = h;
-+ }
-+ }
-+
- if (dynsym && h->dynindx == -1)
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, h))
-@@ -2071,6 +2090,55 @@ elf_link_add_object_symbols (abfd, info)
- }
- }
-
-+ /* Now that all the symbols from this input file are created, handle
-+ .symver foo, foo@BAR such that any relocs against foo become foo@BAR. */
-+ if (nondeflt_vers != NULL)
-+ {
-+ bfd_size_type cnt, symidx;
-+
-+ for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt)
-+ {
-+ struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi;
-+ char *shortname, *p;
-+
-+ p = strchr (h->root.root.string, ELF_VER_CHR);
-+ if (p == NULL
-+ || (h->root.type != bfd_link_hash_defined
-+ && h->root.type != bfd_link_hash_defweak))
-+ continue;
-+
-+ amt = p - h->root.root.string;
-+ shortname = bfd_malloc (amt + 1);
-+ memcpy (shortname, h->root.root.string, amt);
-+ shortname[amt] = '\0';
-+
-+ hi = (struct elf_link_hash_entry *)
-+ bfd_link_hash_lookup (info->hash, shortname,
-+ FALSE, FALSE, FALSE);
-+ if (hi != NULL
-+ && hi->root.type == h->root.type
-+ && hi->root.u.def.value == h->root.u.def.value
-+ && hi->root.u.def.section == h->root.u.def.section)
-+ {
-+ (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
-+ hi->root.type = bfd_link_hash_indirect;
-+ hi->root.u.i.link = (struct bfd_link_hash_entry *) h;
-+ (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
-+ sym_hash = elf_sym_hashes (abfd);
-+ if (sym_hash)
-+ for (symidx = 0; symidx < extsymcount; ++symidx)
-+ if (sym_hash[symidx] == hi)
-+ {
-+ sym_hash[symidx] = h;
-+ break;
-+ }
-+ }
-+ free (shortname);
-+ }
-+ free (nondeflt_vers);
-+ nondeflt_vers = NULL;
-+ }
-+
- if (extversym != NULL)
- {
- free (extversym);
-@@ -2277,6 +2346,8 @@ elf_link_add_object_symbols (abfd, info)
- return TRUE;
-
- error_free_vers:
-+ if (nondeflt_vers != NULL)
-+ free (nondeflt_vers);
- if (extversym != NULL)
- free (extversym);
- error_free_sym:
---- ld/testsuite/ld-elfvers/vers.exp.jj 2002-09-10 08:51:14.000000000 -0400
-+++ ld/testsuite/ld-elfvers/vers.exp 2003-02-09 17:59:11.000000000 -0500
-@@ -43,7 +43,9 @@ if { ![istarget hppa*64*-*-hpux*] \
- && ![istarget sparc*-*-linux*] \
- && ![istarget arm*-*-linux*] \
- && ![istarget mips*-*-linux*] \
-- && ![istarget alpha*-*-linux*] } {
-+ && ![istarget alpha*-*-linux*] \
-+ && ![istarget s390*-*-linux*] \
-+ && ![istarget x86_64-*-linux*] } {
- return
- }
-
-@@ -719,7 +721,12 @@ build_vers_lib "vers1" vers1.c vers1 ""
- # Test #2 - build a library, and link it against the library we built in step
- # 1.
- #
--build_vers_lib "vers2" vers2.c vers2 vers1.so vers2.map vers2.ver vers2.dsym ""
-+if [istarget x86_64-*-linux*] {
-+ # x86_64 doesn't like non-pic shared libraries
-+ xfail "vers2"
-+} else {
-+ build_vers_lib "vers2" vers2.c vers2 vers1.so vers2.map vers2.ver vers2.dsym ""
-+}
-
- #
- # Test #3 - build an executable, and link it against vers1.so.
-@@ -838,3 +845,21 @@ build_vers_lib "vers23b" vers23b.c vers2
- build_vers_lib "vers23c" vers23b.c vers23c "vers23a.so" vers23b.map vers23c.ver vers23b.dsym ""
- build_exec "vers23d" vers23.c vers23d "tmpdir/vers23a.so tmpdir/vers23c.so" "" vers23.ver vers23d.dsym ""
- build_exec "vers23" vers23.c vers23 "tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym ""
-+
-+# Test .symver x,x@VERS.0
-+set as_pic_flags ""
-+if [istarget sparc*-*-*] {
-+ set as_pic_flags "-K PIC"
-+}
-+run_ld_link_tests [list "\"vers24a\"
-+ \"-shared --version-script $srcdir/$subdir/vers24.map\"
-+ \"$as_pic_flags\" {vers24a.c vers24b.c} { { readelf -Wrs vers24.rd } }
-+ \"libvers24a.so\" \"-fpic\""]
-+run_ld_link_tests [list "\"vers24b\"
-+ \"-shared --version-script $srcdir/$subdir/vers24.map\"
-+ \"$as_pic_flags\" {vers24b.c vers24a.c} { { readelf -Wrs vers24.rd } }
-+ \"libvers24b.so\" \"-fpic\""]
-+run_ld_link_tests [list "\"vers24c\"
-+ \"-shared --version-script $srcdir/$subdir/vers24.map\"
-+ \"$as_pic_flags\" {vers24c.c} { { readelf -Wrs vers24.rd } }
-+ \"libvers24c.so\" \"-fpic\""]
---- ld/testsuite/ld-elfvers/vers24a.c.jj 2003-02-08 16:00:04.000000000 -0500
-+++ ld/testsuite/ld-elfvers/vers24a.c 2003-02-08 17:27:53.000000000 -0500
-@@ -0,0 +1,5 @@
-+/* Test whether .symver x, x@foo
-+ causes relocations against x within the same shared library
-+ to become dynamic relocations against x@foo. */
-+int x = 12;
-+__asm__ (".symver x, x@VERS.0");
---- ld/testsuite/ld-elfvers/vers24b.c.jj 2003-02-08 16:00:15.000000000 -0500
-+++ ld/testsuite/ld-elfvers/vers24b.c 2003-02-07 17:43:02.000000000 -0500
-@@ -0,0 +1,5 @@
-+extern int x;
-+void foo (void)
-+{
-+ x = 24;
-+}
---- ld/testsuite/ld-elfvers/vers24.map.jj 2003-02-08 16:00:32.000000000 -0500
-+++ ld/testsuite/ld-elfvers/vers24.map 2003-02-08 16:01:23.000000000 -0500
-@@ -0,0 +1,4 @@
-+VERS.0 {
-+ global: x; foo;
-+ local: *;
-+};
---- ld/testsuite/ld-elfvers/vers3.ver.jj 2001-07-11 09:48:54.000000000 -0400
-+++ ld/testsuite/ld-elfvers/vers3.ver 2003-02-09 17:57:40.000000000 -0500
-@@ -1,4 +1,4 @@
- Version References:
- required from tmpdir/vers1.so:
-- 0x0a7922b0 0x00 02 VERS_2.0
-+ 0x0a7922b0 0x00 0[23] VERS_2.0
-
---- ld/testsuite/ld-elfvers/vers24.rd.jj 2003-02-08 17:18:25.000000000 -0500
-+++ ld/testsuite/ld-elfvers/vers24.rd 2003-02-09 18:22:41.000000000 -0500
-@@ -0,0 +1,15 @@
-+Relocation section .*
-+# Ensure there is a dynamic relocation against x
-+#...
-+[0-9a-f]+ +[0-9a-f]+ R_.* +x(| \+ 0)
-+#...
-+Symbol table '.dynsym' contains [0-9]+ entries:
-+# And ensure the dynamic symbol table contains at least x@VERS.0
-+# and foo@@VERS.0 symbols
-+#...
-+ +[0-9]+: [0-9a-f]+ +(4 OBJECT +GLOBAL DEFAULT +[0-9]+ x|[0-9]+ FUNC +GLOBAL DEFAULT +[0-9]+ foo@)@VERS\.0
-+#...
-+ +[0-9]+: [0-9a-f]+ +(4 OBJECT +GLOBAL DEFAULT +[0-9]+ x|[0-9]+ FUNC +GLOBAL DEFAULT +[0-9]+ foo@)@VERS\.0
-+#...
-+Symbol table '.symtab' contains [0-9]+ entries:
-+#pass
---- ld/testsuite/ld-elfvers/vers24c.c.jj 2003-02-08 17:29:10.000000000 -0500
-+++ ld/testsuite/ld-elfvers/vers24c.c 2003-02-08 17:29:04.000000000 -0500
-@@ -0,0 +1,9 @@
-+/* Test whether .symver x, x@foo
-+ causes relocations against x within the same shared library
-+ to become dynamic relocations against x@foo. */
-+int x = 12;
-+__asm__ (".symver x, x@VERS.0");
-+void foo (void)
-+{
-+ x = 24;
-+}
---- ld/testsuite/ld-elfvers/vers19.ver.jj 2001-05-11 06:26:01.000000000 -0400
-+++ ld/testsuite/ld-elfvers/vers19.ver 2003-02-09 17:57:53.000000000 -0500
-@@ -1,3 +1,3 @@
- Version References:
- required from vers17.so:
-- 0x0a7922b0 0x00 02 VERS_2.0
-+ 0x0a7922b0 0x00 0[23] VERS_2.0
---- ld/testsuite/ld-elfvsb/elfvsb.exp.jj 2002-07-30 10:20:17.000000000 -0400
-+++ ld/testsuite/ld-elfvsb/elfvsb.exp 2003-02-09 18:23:44.000000000 -0500
-@@ -1,5 +1,5 @@
- # Expect script for ld-visibility tests
--# Copyright 2000, 2001 Free Software Foundation, Inc.
-+# Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
- #
- # This file is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
-@@ -35,7 +35,9 @@ if { ![istarget hppa*64*-*-hpux*] \
- && ![istarget powerpc-*-linux*] \
- && ![istarget arm*-*-linux*] \
- && ![istarget alpha*-*-linux*] \
-- && ![istarget sparc*-*-linux*] } {
-+ && ![istarget sparc*-*-linux*] \
-+ && ![istarget s390*-*-linux*] \
-+ && ![istarget x86_64-*-linux*] } {
- return
- }
-
-@@ -255,6 +257,7 @@ proc visibility_run {visibility} {
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
- }
-+ setup_xfail "x86_64-*-linux*"
-
- visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb
-
-@@ -285,6 +288,7 @@ proc visibility_run {visibility} {
- setup_xfail "alpha*-*-linux*"
- setup_xfail "mips*-*-linux*"
- }
-+ setup_xfail "x86_64-*-linux*"
- visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \
- mainnp.o sh1np.o sh2np.o elfvsb \
- "-T $srcdir/$subdir/elf-offset.ld"
-@@ -341,6 +345,7 @@ proc visibility_run {visibility} {
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
- }
-+ setup_xfail "x86_64-*-linux*"
- visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
- }
- } else {
---- ld/testsuite/lib/ld-lib.exp.jj 2002-12-28 17:19:23.000000000 -0500
-+++ ld/testsuite/lib/ld-lib.exp 2003-02-08 16:15:19.000000000 -0500
-@@ -1,5 +1,5 @@
- # Support routines for LD testsuite.
--# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- # Free Software Foundation, Inc.
- #
- # This file is free software; you can redistribute it and/or modify
-@@ -978,9 +978,11 @@ proc file_contents { filename } {
- return $contents
- }
-
--# List contains test-items with 3 items followed by 2 lists:
-+# List contains test-items with 3 items followed by 2 lists, one item and
-+# one optional item:
- # 0:name 1:ld options 2:assembler options
- # 3:filenames of assembler files 4: action and options. 5: name of output file
-+# 6:compiler flags (optional)
-
- # Actions:
- # objdump: Apply objdump options on result. Compare with regex (last arg).
-@@ -996,14 +998,17 @@ proc run_ld_link_tests { ldtests } {
- global srcdir
- global subdir
- global env
-+ global CC
-+ global CFLAGS
-
- foreach testitem $ldtests {
- set testname [lindex $testitem 0]
- set ld_options [lindex $testitem 1]
- set as_options [lindex $testitem 2]
-- set as_files [lindex $testitem 3]
-+ set src_files [lindex $testitem 3]
- set actions [lindex $testitem 4]
- set binfile tmpdir/[lindex $testitem 5]
-+ set cflags [lindex $testitem 6]
- set objfiles {}
- set is_unresolved 0
- set failed 0
-@@ -1011,16 +1016,25 @@ proc run_ld_link_tests { ldtests } {
- # verbose -log "Testname is $testname"
- # verbose -log "ld_options is $ld_options"
- # verbose -log "as_options is $as_options"
--# verbose -log "as_files is $as_files"
-+# verbose -log "src_files is $src_files"
- # verbose -log "actions is $actions"
- # verbose -log "binfile is $binfile"
-
- # Assemble each file in the test.
-- foreach as_file $as_files {
-- set objfile "tmpdir/[file rootname $as_file].o"
-+ foreach src_file $src_files {
-+ set objfile "tmpdir/[file rootname $src_file].o"
- lappend objfiles $objfile
-
-- if ![ld_assemble $as "$as_options $srcdir/$subdir/$as_file" $objfile] {
-+ if { [file extension $src_file] == ".c" } {
-+ set as_file "tmpdir/[file rootname $src_file].s"
-+ if ![ld_compile "$CC -S $CFLAGS $cflags" $srcdir/$subdir/$src_file $as_file] {
-+ set is_unresolved 1
-+ break
-+ }
-+ } else {
-+ set as_file "$srcdir/$subdir/$src_file"
-+ }
-+ if ![ld_assemble $as "$as_options $as_file" $objfile] {
- set is_unresolved 1
- break
- }
---- ld/testsuite/ld-shared/shared.exp.jj 2002-07-30 10:20:20.000000000 -0400
-+++ ld/testsuite/ld-shared/shared.exp 2003-02-09 18:00:00.000000000 -0500
-@@ -1,5 +1,5 @@
- # Expect script for ld-shared tests
--# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
- # Free Software Foundation, Inc.
- #
- # This file is free software; you can redistribute it and/or modify
-@@ -49,7 +49,9 @@ if { ![istarget hppa*64*-*-hpux*] \
- && ![istarget arm*-*-linux*] \
- && ![istarget alpha*-*-linux*] \
- && ![istarget rs6000*-*-aix*] \
-- && ![istarget powerpc*-*-aix*] } {
-+ && ![istarget powerpc*-*-aix*] \
-+ && ![istarget s390*-*-linux*] \
-+ && ![istarget x86_64-*-linux*] } {
- return
- }
-
-@@ -198,6 +200,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $
- setup_xfail "*-*-sunos4*"
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
-+ setup_xfail "x86_64-*-linux*"
- shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
-
- # Test ELF shared library relocations with a non-zero load
-@@ -210,6 +213,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
- setup_xfail "mips*-*-linux*"
-+ setup_xfail "x86_64-*-linux*"
- shared_test shnp "shared (non PIC, load offset)" \
- mainnp.o sh1np.o sh2np.o shared \
- "-T $srcdir/$subdir/elf-offset.ld"
-@@ -251,6 +255,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p
- setup_xfail "*-*-sunos4*"
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
-+ setup_xfail "x86_64-*-linux*"
- shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared
- }
- } else {
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-hdr.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-hdr.patch
deleted file mode 100644
index b832e42fe3ee..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-hdr.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-2003-02-06 Andreas Schwab <schwab@suse.de>
-
- * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
- (read_value): Add parameter is_signed, use signed extraction if
- the value is signed.
- (_bfd_elf_write_section_eh_frame): Pass signed flag of the
- encoding to read_value.
-
---- bfd/elf-eh-frame.c.~1.21.~ 2003-02-04 14:21:18.000000000 +0100
-+++ bfd/elf-eh-frame.c 2003-02-06 16:03:07.000000000 +0100
-@@ -33,7 +33,7 @@ static bfd_signed_vma read_signed_leb128
- static int get_DW_EH_PE_width
- PARAMS ((int, int));
- static bfd_vma read_value
-- PARAMS ((bfd *, bfd_byte *, int));
-+ PARAMS ((bfd *, bfd_byte *, int, int));
- static void write_value
- PARAMS ((bfd *, bfd_byte *, bfd_vma, int));
- static int cie_compare
-@@ -141,22 +141,42 @@ int get_DW_EH_PE_width (encoding, ptr_si
- return 0;
- }
-
-+#define get_DW_EH_PE_signed(encoding) (((encoding) & DW_EH_PE_signed) != 0)
-+
- /* Read a width sized value from memory. */
-
- static bfd_vma
--read_value (abfd, buf, width)
-+read_value (abfd, buf, width, is_signed)
- bfd *abfd;
- bfd_byte *buf;
- int width;
-+ int is_signed;
- {
- bfd_vma value;
-
- switch (width)
- {
-- case 2: value = bfd_get_16 (abfd, buf); break;
-- case 4: value = bfd_get_32 (abfd, buf); break;
-- case 8: value = bfd_get_64 (abfd, buf); break;
-- default: BFD_FAIL (); return 0;
-+ case 2:
-+ if (is_signed)
-+ value = bfd_get_signed_16 (abfd, buf);
-+ else
-+ value = bfd_get_16 (abfd, buf);
-+ break;
-+ case 4:
-+ if (is_signed)
-+ value = bfd_get_signed_32 (abfd, buf);
-+ else
-+ value = bfd_get_32 (abfd, buf);
-+ break;
-+ case 8:
-+ if (is_signed)
-+ value = bfd_get_signed_64 (abfd, buf);
-+ else
-+ value = bfd_get_64 (abfd, buf);
-+ break;
-+ default:
-+ BFD_FAIL ();
-+ return 0;
- }
-
- return value;
-@@ -925,7 +945,9 @@ _bfd_elf_write_section_eh_frame (abfd, i
- {
- bfd_vma value;
-
-- value = read_value (abfd, buf, per_width);
-+ value = read_value (abfd, buf, per_width,
-+ get_DW_EH_PE_signed
-+ (per_encoding));
- value += (sec_info->entry[i].offset
- - sec_info->entry[i].new_offset);
- write_value (abfd, buf, value, per_width);
-@@ -961,7 +983,9 @@ _bfd_elf_write_section_eh_frame (abfd, i
- buf += 4;
- width = get_DW_EH_PE_width (sec_info->entry[i].fde_encoding,
- ptr_size);
-- address = value = read_value (abfd, buf, width);
-+ address = value = read_value (abfd, buf, width,
-+ get_DW_EH_PE_signed
-+ (sec_info->entry[i].fde_encoding));
- if (value)
- {
- switch (sec_info->entry[i].fde_encoding & 0xf0)
-@@ -1005,7 +1029,9 @@ _bfd_elf_write_section_eh_frame (abfd, i
- buf += sec_info->entry[i].lsda_offset;
- width = get_DW_EH_PE_width (sec_info->entry[i].lsda_encoding,
- ptr_size);
-- value = read_value (abfd, buf, width);
-+ value = read_value (abfd, buf, width,
-+ get_DW_EH_PE_signed
-+ (sec_info->entry[i].lsda_encoding));
- if (value)
- {
- if ((sec_info->entry[i].lsda_encoding & 0xf0)
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-ro.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-ro.patch
deleted file mode 100644
index 2e9d15bb7926..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-eh-frame-ro.patch
+++ /dev/null
@@ -1,475 +0,0 @@
-2002-11-22 Jakub Jelinek <jakub@redhat.com>
-
- * ldgram.y (sect_constraint): New.
- (ONLY_IF_RO, ONLY_IF_RW): New tokens.
- (section): Add sect_constraint. Pass additional argument
- to lang_enter_output_section_statement.
- * mri.c (mri_draw_tree): Pass additional argument to
- lang_enter_output_section_statement.
- * emultempl/pe.em (place_orphan): Likewise.
- (output_prev_sec_find): Disregard output section statements with
- constraint == -1.
- * emultempl/mmo.em (output_prev_sec_find): Likewise.
- (mmo_place_orphan): Pass additional argument to
- lang_enter_output_section_statement.
- * emultempl/elf32.em (output_prev_sec_find): Disregard output section
- statements with constraint == -1.
- (place_orphan): Pass additional argument to
- lang_enter_output_section_statement.
- * ldlang.c (lang_enter_overlay_section): Likewise.
- (lang_output_section_find_1): New.
- (lang_output_section_find): Use it.
- (lang_output_section_statement_lookup_1): New.
- (lang_output_section_statement_lookup): Use it.
- (check_section_callback, check_input_sections): New.
- (map_input_to_output_sections): Check if all input sections
- are readonly if ONLY_IF_RO or ONLY_IF_RW was seen.
- (strip_excluded_output_sections): Disregard output section statements
- with constraint == -1.
- (lang_record_phdrs): Likewise.
- (lang_enter_output_section_statement): Add constraint argument.
- Use lang_output_section_statement_lookup_1.
- * ldlang.h (lang_output_section_statement_type): Add constraint
- and all_input_readonly fields.
- (lang_enter_output_section_statement): Adjust prototype.
- * ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens.
- * scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text
- segment if all input sections are readonly.
-
---- ld/emultempl/mmo.em.jj Mon Dec 16 15:22:53 2002
-+++ ld/emultempl/mmo.em Thu Feb 6 08:33:16 2003
-@@ -56,6 +56,8 @@ output_prev_sec_find (os)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-+ if (lookup->constraint == -1)
-+ continue;
- if (lookup == os)
- break;
- if (lookup->bfd_section != NULL
-@@ -141,7 +143,7 @@ mmo_place_orphan (file, s)
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
-
- lang_add_section (&os->children, s, os, file);
-
---- ld/emultempl/pe.em.jj Thu Feb 6 08:07:12 2003
-+++ ld/emultempl/pe.em Thu Feb 6 08:33:16 2003
-@@ -1508,6 +1508,8 @@ output_prev_sec_find (os)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-+ if (lookup->constraint == -1)
-+ continue;
- if (lookup == os)
- return s;
-
-@@ -1674,7 +1676,7 @@ gld_${EMULATION_NAME}_place_orphan (file
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
-
- lang_add_section (&add_child, s, os, file);
-
---- ld/emultempl/elf32.em.jj Thu Feb 6 08:07:12 2003
-+++ ld/emultempl/elf32.em Thu Feb 6 08:38:28 2003
-@@ -1053,7 +1053,8 @@ output_rel_find (sec)
- for (u = lang_output_section_statement.head; u; u = lookup->next)
- {
- lookup = &u->output_section_statement;
-- if (strncmp (".rel", lookup->name, 4) == 0)
-+ if (lookup->constraint != -1
-+ && strncmp (".rel", lookup->name, 4) == 0)
- {
- /* Don't place after .rel.plt as doing so results in wrong
- dynamic tags. Also, place allocated reloc sections before
-@@ -1293,7 +1294,7 @@ gld${EMULATION_NAME}_place_orphan (file,
- (bfd_vma) 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
-- load_base);
-+ load_base, 0);
-
- lang_add_section (&os->children, s, os, file);
-
---- ld/scripttempl/elf.sc.jj Fri Sep 27 11:33:09 2002
-+++ ld/scripttempl/elf.sc Thu Feb 6 08:33:16 2003
-@@ -280,6 +280,8 @@ cat <<EOF
- ${CREATE_SHLIB-${SBSS2}}
- ${OTHER_READONLY_SECTIONS}
- .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table) }
-
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
-@@ -312,8 +314,8 @@ cat <<EOF
- .data1 ${RELOCATING-0} : { *(.data1) }
- .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
- .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
-- .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
-- .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
-+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table) }
- ${WRITABLE_RODATA+${RODATA}}
- ${OTHER_READWRITE_SECTIONS}
- ${TEXT_DYNAMIC-${DYNAMIC}}
---- ld/ldgram.y.jj Tue Jan 21 13:21:34 2003
-+++ ld/ldgram.y Thu Feb 6 08:33:16 2003
-@@ -143,14 +143,14 @@ static int error_index;
- %token ORIGIN FILL
- %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
- %token ALIGNMOD AT PROVIDE
--%type <token> assign_op atype attributes_opt
-+%type <token> assign_op atype attributes_opt sect_constraint
- %type <name> filename
- %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
- %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
- %token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
- %token <name> VERS_TAG VERS_IDENTIFIER
- %token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
--%token KEEP
-+%token KEEP ONLY_IF_RO ONLY_IF_RW
- %token EXCLUDE_FILE
- %type <versyms> vers_defns
- %type <versnode> vers_tag
-@@ -828,21 +828,28 @@ opt_at:
- | { $$ = 0; }
- ;
-
-+sect_constraint:
-+ ONLY_IF_RO { $$ = ONLY_IF_RO; }
-+ | ONLY_IF_RW { $$ = ONLY_IF_RW; }
-+ | { $$ = 0; }
-+ ;
-+
- section: NAME { ldlex_expression(); }
- opt_exp_with_type
- opt_at { ldlex_popstate (); ldlex_script (); }
-+ sect_constraint
- '{'
- {
- lang_enter_output_section_statement($1, $3,
- sectype,
-- 0, 0, 0, $4);
-+ 0, 0, 0, $4, $6);
- }
- statement_list_opt
- '}' { ldlex_popstate (); ldlex_expression (); }
- memspec_opt memspec_at_opt phdr_opt fill_opt
- {
- ldlex_popstate ();
-- lang_leave_output_section_statement ($14, $11, $13, $12);
-+ lang_leave_output_section_statement ($15, $12, $14, $13);
- }
- opt_comma
- {}
---- ld/mri.c.jj Tue Jan 21 13:21:34 2003
-+++ ld/mri.c Thu Feb 6 08:33:16 2003
-@@ -237,7 +237,7 @@ mri_draw_tree ()
- lang_enter_output_section_statement (p->name, base,
- p->ok_to_load ? 0 : noload_section,
- 1, align, subalign,
-- (etree_type *) NULL);
-+ (etree_type *) NULL, 0);
- base = 0;
- tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
- tmp->next = NULL;
---- ld/ldlang.h.jj Mon Dec 16 15:22:53 2002
-+++ ld/ldlang.h Thu Feb 6 08:39:55 2003
-@@ -132,6 +132,8 @@ typedef struct lang_output_section_state
-
- int subsection_alignment; /* alignment of components */
- int section_alignment; /* alignment of start of section */
-+ int constraint;
-+ bfd_boolean all_input_readonly;
-
- union etree_union *load_base;
-
-@@ -388,7 +390,7 @@ extern lang_output_section_statement_typ
- bfd_vma block_value,
- etree_type *align,
- etree_type *subalign,
-- etree_type *));
-+ etree_type *, int));
- extern void lang_final
- PARAMS ((void));
- extern void lang_process
---- ld/ldlang.c.jj Tue Jan 21 13:21:34 2003
-+++ ld/ldlang.c Thu Feb 6 08:44:49 2003
-@@ -73,6 +73,10 @@ static lang_input_statement_type *new_af
- bfd_boolean));
- static lang_memory_region_type *lang_memory_default
- PARAMS ((asection *));
-+static lang_output_section_statement_type * lang_output_section_find_1
-+ PARAMS ((const char *, int));
-+static lang_output_section_statement_type *
-+ lang_output_section_statement_lookup_1 PARAMS ((const char *, int));
- static void lang_map_flags
- PARAMS ((flagword));
- static void init_os
-@@ -95,6 +99,9 @@ static lang_statement_union_type *wild_s
- static void output_section_callback
- PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
- lang_input_statement_type *, PTR));
-+static void check_section_callback
-+ PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
-+ lang_input_statement_type *, PTR));
- static lang_input_statement_type *lookup_name
- PARAMS ((const char *));
- static bfd_boolean load_symbols
-@@ -112,6 +119,9 @@ static void lang_reasonable_defaults
- PARAMS ((void));
- static void insert_undefined
- PARAMS ((const char *));
-+static void check_input_sections
-+ PARAMS ((lang_statement_union_type *,
-+ lang_output_section_statement_type *));
- static void lang_place_undefineds
- PARAMS ((void));
- static void map_input_to_output_sections
-@@ -742,9 +752,10 @@ lang_memory_default (section)
- return lang_memory_region_lookup ("*default*");
- }
-
--lang_output_section_statement_type *
--lang_output_section_find (name)
-+static lang_output_section_statement_type *
-+lang_output_section_find_1 (name, constraint)
- const char *const name;
-+ int constraint;
- {
- lang_statement_union_type *u;
- lang_output_section_statement_type *lookup;
-@@ -754,7 +765,9 @@ lang_output_section_find (name)
- u = lookup->next)
- {
- lookup = &u->output_section_statement;
-- if (strcmp (name, lookup->name) == 0)
-+ if (strcmp (name, lookup->name) == 0
-+ && lookup->constraint != -1
-+ && (constraint == 0 || constraint == lookup->constraint))
- {
- return lookup;
- }
-@@ -763,12 +776,20 @@ lang_output_section_find (name)
- }
-
- lang_output_section_statement_type *
--lang_output_section_statement_lookup (name)
-+lang_output_section_find (name)
-+ const char *const name;
-+{
-+ return lang_output_section_find_1 (name, 0);
-+}
-+
-+static lang_output_section_statement_type *
-+lang_output_section_statement_lookup_1 (name, constraint)
- const char *const name;
-+ int constraint;
- {
- lang_output_section_statement_type *lookup;
-
-- lookup = lang_output_section_find (name);
-+ lookup = lang_output_section_find_1 (name, constraint);
- if (lookup == (lang_output_section_statement_type *) NULL)
- {
-
-@@ -783,6 +804,7 @@ lang_output_section_statement_lookup (na
- lookup->next = (lang_statement_union_type *) NULL;
- lookup->bfd_section = (asection *) NULL;
- lookup->processed = FALSE;
-+ lookup->constraint = constraint;
- lookup->sectype = normal_section;
- lookup->addr_tree = (etree_type *) NULL;
- lang_list_init (&lookup->children);
-@@ -802,6 +824,13 @@ lang_output_section_statement_lookup (na
- return lookup;
- }
-
-+lang_output_section_statement_type *
-+lang_output_section_statement_lookup (name)
-+ const char *const name;
-+{
-+ return lang_output_section_statement_lookup_1 (name, 0);
-+}
-+
- static void
- lang_map_flags (flag)
- flagword flag;
-@@ -1479,6 +1508,31 @@ output_section_callback (ptr, sec, secti
- }
- }
-
-+/* Check if all sections in a wild statement for a particular FILE
-+ are readonly. */
-+
-+static void
-+check_section_callback (ptr, sec, section, file, output)
-+ lang_wild_statement_type *ptr ATTRIBUTE_UNUSED;
-+ struct wildcard_list *sec ATTRIBUTE_UNUSED;
-+ asection *section;
-+ lang_input_statement_type *file ATTRIBUTE_UNUSED;
-+ PTR output;
-+{
-+ /* Exclude sections that match UNIQUE_SECTION_LIST. */
-+ if (unique_section_p (bfd_get_section_name (file->the_bfd, section)))
-+ return;
-+
-+ if (section->output_section == NULL)
-+ {
-+ flagword flags = bfd_get_section_flags (section->owner, section);
-+
-+ if ((flags & SEC_READONLY) == 0)
-+ ((lang_output_section_statement_type *) output)->all_input_readonly
-+ = FALSE;
-+ }
-+}
-+
- /* This is passed a file name which must have been seen already and
- added to the statement tree. We will see if it has been opened
- already and had its symbols read. If not then we'll read it. */
-@@ -2144,6 +2198,41 @@ lang_place_undefineds ()
- }
- }
-
-+/* Check for all readonly or some readwrite sections. */
-+
-+static void
-+check_input_sections (s, output_section_statement)
-+ lang_statement_union_type *s;
-+ lang_output_section_statement_type *output_section_statement;
-+{
-+ for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
-+ {
-+ switch (s->header.type)
-+ {
-+ case lang_wild_statement_enum:
-+ walk_wild (&s->wild_statement, check_section_callback,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ case lang_constructors_statement_enum:
-+ check_input_sections (constructor_list.head,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ case lang_group_statement_enum:
-+ check_input_sections (s->group_statement.children.head,
-+ output_section_statement);
-+ if (! output_section_statement->all_input_readonly)
-+ return;
-+ break;
-+ default:
-+ break;
-+ }
-+ }
-+}
-+
- /* Open input files and attach to output sections. */
-
- static void
-@@ -2165,6 +2254,23 @@ map_input_to_output_sections (s, target,
- output_section_statement);
- break;
- case lang_output_section_statement_enum:
-+ if (s->output_section_statement.constraint)
-+ {
-+ if (s->output_section_statement.constraint == -1)
-+ break;
-+ s->output_section_statement.all_input_readonly = TRUE;
-+ check_input_sections (s->output_section_statement.children.head,
-+ &s->output_section_statement);
-+ if ((s->output_section_statement.all_input_readonly
-+ && s->output_section_statement.constraint == ONLY_IF_RW)
-+ || (!s->output_section_statement.all_input_readonly
-+ && s->output_section_statement.constraint == ONLY_IF_RO))
-+ {
-+ s->output_section_statement.constraint = -1;
-+ break;
-+ }
-+ }
-+
- map_input_to_output_sections (s->output_section_statement.children.head,
- target,
- &s->output_section_statement);
-@@ -2235,6 +2341,8 @@ strip_excluded_output_sections ()
- asection *s;
-
- os = &u->output_section_statement;
-+ if (os->constraint == -1)
-+ continue;
- s = os->bfd_section;
- if (s != NULL && (s->flags & SEC_EXCLUDE) != 0)
- {
-@@ -4102,7 +4210,7 @@ topower (x)
- lang_output_section_statement_type *
- lang_enter_output_section_statement (output_section_statement_name,
- address_exp, sectype, block_value,
-- align, subalign, ebase)
-+ align, subalign, ebase, constraint)
- const char *output_section_statement_name;
- etree_type *address_exp;
- enum section_type sectype;
-@@ -4110,12 +4218,14 @@ lang_enter_output_section_statement (out
- etree_type *align;
- etree_type *subalign;
- etree_type *ebase;
-+ int constraint;
- {
- lang_output_section_statement_type *os;
-
- current_section =
- os =
-- lang_output_section_statement_lookup (output_section_statement_name);
-+ lang_output_section_statement_lookup_1 (output_section_statement_name,
-+ constraint);
-
- /* Add this statement to tree. */
- #if 0
-@@ -4830,6 +4940,8 @@ lang_record_phdrs ()
- struct lang_output_section_phdr_list *pl;
-
- os = &u->output_section_statement;
-+ if (os->constraint == -1)
-+ continue;
-
- pl = os->phdrs;
- if (pl != NULL)
-@@ -4890,7 +5002,8 @@ lang_record_phdrs ()
- {
- struct lang_output_section_phdr_list *pl;
-
-- if (u->output_section_statement.bfd_section == NULL)
-+ if (u->output_section_statement.constraint == -1
-+ || u->output_section_statement.bfd_section == NULL)
- continue;
-
- for (pl = u->output_section_statement.phdrs;
-@@ -4960,7 +5073,7 @@ lang_enter_overlay_section (name)
- etree_type *size;
-
- lang_enter_output_section_statement (name, overlay_vma, normal_section,
-- 0, 0, 0, 0);
-+ 0, 0, 0, 0, 0);
-
- /* If this is the first section, then base the VMA of future
- sections on this one. This will work correctly even if `.' is
---- ld/ldlex.l.jj Sat Nov 9 14:08:31 2002
-+++ ld/ldlex.l Thu Feb 6 08:33:16 2003
-@@ -303,6 +303,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?
- <EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
- <EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
- <EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
-+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); }
-+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); }
- <BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
- <BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
- <BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ld-r.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ld-r.patch
deleted file mode 100644
index c1d152db55c7..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ld-r.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- bfd/elflink.h.jj 2003-02-22 15:46:41.000000000 -0500
-+++ bfd/elflink.h 2003-02-24 09:27:06.000000000 -0500
-@@ -8328,9 +8328,10 @@ elf_bfd_discard_info (output_bfd, info)
- continue;
-
- eh = bfd_get_section_by_name (abfd, ".eh_frame");
-- if (eh != NULL
-- && (eh->_raw_size == 0
-- || bfd_is_abs_section (eh->output_section)))
-+ if (info->relocateable
-+ || (eh != NULL
-+ && (eh->_raw_size == 0
-+ || bfd_is_abs_section (eh->output_section))))
- eh = NULL;
-
- stab = bfd_get_section_by_name (abfd, ".stab");
-@@ -8431,6 +8432,7 @@ elf_bfd_discard_info (output_bfd, info)
- }
-
- if (info->eh_frame_hdr
-+ && !info->relocateable
- && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
- ret = TRUE;
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-libpath-suffix.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-libpath-suffix.patch
deleted file mode 100644
index b8882962a252..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-libpath-suffix.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-2003-02-06 Jakub Jelinek <jakub@redhat.com>
-
- * emulparams/elf64_s390.sh (LIBPATH_SUFFIX): Set to 64.
- * emulparams/elf_x86_64.sh (LIBPATH_SUFFIX): Likewise.
- * emulparams/elf64_sparc.sh (LIBPATH_SUFFIX): Set instead of suffix.
-
---- ld/emulparams/elf64_s390.sh.jj 2003-01-08 10:02:43.000000000 -0500
-+++ ld/emulparams/elf64_s390.sh 2003-02-06 09:37:12.000000000 -0500
-@@ -26,7 +26,7 @@ case "$target" in
- s390*-linux*)
- case "$EMULATION_NAME" in
- *64*)
-- LIBPATH_SUFFIX=$suffix ;;
-+ LIBPATH_SUFFIX=64 ;;
- esac
- ;;
- esac
---- ld/emulparams/elf_x86_64.sh.jj 2003-01-08 10:02:44.000000000 -0500
-+++ ld/emulparams/elf_x86_64.sh 2003-02-06 09:37:38.000000000 -0500
-@@ -24,7 +24,7 @@ fi
- case "$target" in
- x86_64*-linux*)
- case "$EMULATION_NAME" in
-- *64*) LIBPATH_SUFFIX=$suffix ;;
-+ *64*) LIBPATH_SUFFIX=64 ;;
- esac
- ;;
- esac
---- ld/emulparams/elf64_sparc.sh.jj 2003-01-08 10:02:44.000000000 -0500
-+++ ld/emulparams/elf64_sparc.sh 2003-02-06 09:39:50.000000000 -0500
-@@ -42,9 +42,9 @@ case "$EMULATION_NAME" in
- *64*)
- case "$target" in
- sparc*-linux*)
-- suffix=64 ;;
-+ LIBPATH_SUFFIX=64 ;;
- sparc*-solaris*)
-- suffix=/sparcv9 ;;
-+ LIBPATH_SUFFIX=/sparcv9 ;;
- esac
- ;;
- esac
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls1.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls1.patch
deleted file mode 100644
index d3b6e0a2879e..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls1.patch
+++ /dev/null
@@ -1,1796 +0,0 @@
-2003-02-09 Alan Modra <amodra@bigpond.net.au>
-
-bfd/ChangeLog
- * elf64-ppc.c (TLS_GD_LD): Don't define..
- (TLS_GD): ..define this instead and update all uses.
- (TLS_TPRELGD): Define.
- (ppc64_elf_link_hash_table_create): Tweak initialization of
- init_refcount and init_offset.
- (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
- Mark second slot of GD or LD toc entries.
- (get_tls_type): Return an int. Distinguish toc GD and LD entries
- from other tls types.
- (ppc64_elf_tls_setup): New function, split out from..
- (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are
- defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL
- on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type
- return value to properly decide whether toc GD and LD entries can
- optimize away __tls_get_addr call. Check next reloc after DTPMOD64
- to determine GD or LD rather than looking at TLS_LD flag. Don't
- attempt to adjust got entry tls_type here..
- (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
- look for possible merges.
- (ppc64_elf_size_dynamic_sections): Adjust local got entries for
- optimization.
- (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
- (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
- Make use of return value from get_tls_type to properly detect GD and
- LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't
- handle tls_get_addr removal when looking at REL24 relocs, do it when
- looking at the previous reloc. Check reloc after DTPMOD64 to determine
- GD or LD.
- * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
-
-ld/ChangeLog
- * emultempl/ppc64elf.em: Add "no-tls-optimize" option and support code.
-
-ld/testsuite/ChangeLog
- * ld-powerpc/tlslib.s: Give .__tls_get_addr function type.
- * ld-powerpc/tlsexe.d: Update for changed handling of (invalid) ld var
- in dynamic lib.
- * ld-powerpc/tlsexe.g: Likewise.
- * ld-powerpc/tlsexe.r: Likewise.
- * ld-powerpc/tlsexe.t: Likewise.
- * ld-powerpc/tlsexetoc.d: Likewise.
- * ld-powerpc/tlsexetoc.g: Likewise.
- * ld-powerpc/tlsexetoc.r: Likewise.
- * ld-powerpc/tlsexetoc.t: Likewise.
-
---- bfd/elf64-ppc.c 5 Feb 2003 15:49:04 -0000 1.81
-+++ bfd/elf64-ppc.c 9 Feb 2003 04:34:05 -0000
-@@ -2635,11 +2635,12 @@ struct ppc_link_hash_entry
- /* Contexts in which symbol is used in the GOT (or TOC).
- Linker optimization will result in various transformations. */
- #define TLS_TLS 1 /* Any TLS reloc. */
--#define TLS_GD_LD 2 /* GD or LD reloc requiring 2 got slots. */
-+#define TLS_GD 2 /* GD reloc. */
- #define TLS_LD 4 /* LD reloc. */
- #define TLS_TPREL 8 /* TPREL reloc, => IE. */
- #define TLS_DTPREL 16 /* DTPREL reloc, => LD. */
- #define TLS_EXPLICIT 32 /* Marks TOC section relocs. */
-+#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */
- char tls_type;
- };
-
-@@ -2767,7 +2768,7 @@ static void ppc64_elf_hide_symbol
- static bfd_boolean get_sym_h
- PARAMS ((struct elf_link_hash_entry **, Elf_Internal_Sym **, asection **,
- char **, Elf_Internal_Sym **, unsigned long, bfd *));
--static bfd_boolean get_tls_type
-+static int get_tls_type
- PARAMS ((char **, Elf_Internal_Sym **, const Elf_Internal_Rela *, bfd *));
- static bfd_boolean allocate_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-@@ -2963,7 +2964,13 @@ ppc64_elf_link_hash_table_create (abfd)
- htab->have_undefweak = 0;
- htab->stub_iteration = 0;
- htab->sym_sec.abfd = NULL;
-+ /* Initializing two fields of the union is just cosmetic. We really
-+ only care about glist, but when compiled on a 32-bit host the
-+ bfd_vma fields are larger. Setting the bfd_vma to zero makes
-+ debugger inspection of these fields look nicer. */
-+ htab->elf.init_refcount.refcount = 0;
- htab->elf.init_refcount.glist = NULL;
-+ htab->elf.init_offset.offset = 0;
- htab->elf.init_offset.glist = NULL;
-
- return &htab->elf.root;
-@@ -3556,14 +3563,14 @@ ppc64_elf_check_relocs (abfd, info, sec,
- case R_PPC64_GOT_TLSLD16_HI:
- case R_PPC64_GOT_TLSLD16_HA:
- htab->tlsld_got.refcount += 1;
-- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
-+ tls_type = TLS_TLS | TLS_LD;
- goto dogottls;
-
- case R_PPC64_GOT_TLSGD16:
- case R_PPC64_GOT_TLSGD16_LO:
- case R_PPC64_GOT_TLSGD16_HI:
- case R_PPC64_GOT_TLSGD16_HA:
-- tls_type = TLS_TLS | TLS_GD_LD;
-+ tls_type = TLS_TLS | TLS_GD;
- goto dogottls;
-
- case R_PPC64_GOT_TPREL16_DS:
-@@ -3727,9 +3734,9 @@ ppc64_elf_check_relocs (abfd, info, sec,
- if (rel + 1 < rel_end
- && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)
- && rel[1].r_offset == rel->r_offset + 8)
-- tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD;
-+ tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD;
- else
-- tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD | TLS_LD;
-+ tls_type = TLS_EXPLICIT | TLS_TLS | TLS_LD;
- goto dotlstoc;
-
- case R_PPC64_DTPREL64:
-@@ -3756,7 +3763,8 @@ ppc64_elf_check_relocs (abfd, info, sec,
-
- if (ppc64_elf_section_data (sec)->t_symndx == NULL)
- {
-- bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8;
-+ /* One extra to simplify get_tls_type. */
-+ bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1;
- ppc64_elf_section_data (sec)->t_symndx
- = (unsigned *) bfd_zalloc (abfd, amt);
- if (ppc64_elf_section_data (sec)->t_symndx == NULL)
-@@ -3764,6 +3772,13 @@ ppc64_elf_check_relocs (abfd, info, sec,
- }
- BFD_ASSERT (rel->r_offset % 8 == 0);
- ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8] = r_symndx;
-+
-+ /* Mark the second slot of a GD or LD entry.
-+ -1 to indicate GD and -2 to indicate LD. */
-+ if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_GD))
-+ ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -1;
-+ else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD))
-+ ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2;
- goto dodyn;
-
- case R_PPC64_TPREL16:
-@@ -4090,14 +4105,14 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec
- case R_PPC64_GOT_TLSLD16_HI:
- case R_PPC64_GOT_TLSLD16_HA:
- htab->tlsld_got.refcount -= 1;
-- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
-+ tls_type = TLS_TLS | TLS_LD;
- goto dogot;
-
- case R_PPC64_GOT_TLSGD16:
- case R_PPC64_GOT_TLSGD16_LO:
- case R_PPC64_GOT_TLSGD16_HI:
- case R_PPC64_GOT_TLSGD16_HA:
-- tls_type = TLS_TLS | TLS_GD_LD;
-+ tls_type = TLS_TLS | TLS_GD;
- goto dogot;
-
- case R_PPC64_GOT_TPREL16_DS:
-@@ -4768,7 +4783,11 @@ get_sym_h (hp, symp, symsecp, tlstypep,
- return TRUE;
- }
-
--static bfd_boolean
-+/* Returns TLS_TYPE for the given REL symbol. Function return is 0 on
-+ error, 2 on a toc GD type suitable for optimization, 3 on a toc LD
-+ type suitable for optimization, and 1 otherwise. */
-+
-+static int
- get_tls_type (tls_type, locsymsp, rel, ibfd)
- char **tls_type;
- Elf_Internal_Sym **locsymsp;
-@@ -4776,6 +4795,7 @@ get_tls_type (tls_type, locsymsp, rel, i
- bfd *ibfd;
- {
- unsigned long r_symndx;
-+ unsigned int next_r;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sec;
-@@ -4783,12 +4803,12 @@ get_tls_type (tls_type, locsymsp, rel, i
-
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd))
-- return FALSE;
-+ return 0;
-
- if ((*tls_type != NULL && **tls_type != 0)
- || sec == NULL
- || ppc64_elf_section_data (sec)->t_symndx == NULL)
-- return TRUE;
-+ return 1;
-
- /* Look inside a TOC section too. */
- if (h != NULL)
-@@ -4801,7 +4821,21 @@ get_tls_type (tls_type, locsymsp, rel, i
- off += rel->r_addend;
- BFD_ASSERT (off % 8 == 0);
- r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8];
-- return get_sym_h (&h, &sym, NULL, tls_type, locsymsp, r_symndx, ibfd);
-+ next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1];
-+ if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd))
-+ return 0;
-+ if (h == NULL
-+ || h->root.type == bfd_link_hash_defined
-+ || h->root.type == bfd_link_hash_defweak)
-+ {
-+ if (next_r == (unsigned) -1)
-+ return 2;
-+ if (next_r == (unsigned) -2
-+ && (h == NULL
-+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
-+ return 3;
-+ }
-+ return 1;
- }
-
- bfd_boolean
-@@ -5110,39 +5144,46 @@ ppc64_elf_edit_opd (obfd, info)
- return TRUE;
- }
-
--/* Run through all the TLS relocs looking for optimization
-- opportunities. The linker has been hacked (see ppc64elf.em) to do
-- a preliminary section layout so that we know the TLS segment
-- offsets. We can't optimize earlier because some optimizations need
-- to know the tp offset, and we need to optimize before allocating
-- dynamic relocations. */
-+/* Set htab->tls_sec. */
-
- bfd_boolean
--ppc64_elf_tls_optimize (obfd, info)
-+ppc64_elf_tls_setup (obfd, info)
- bfd *obfd;
- struct bfd_link_info *info;
- {
- asection *tls;
-- bfd *ibfd;
-- asection *sec;
- struct ppc_link_hash_table *htab;
-
-- if (info->relocateable)
-- return TRUE;
--
- for (tls = obfd->sections; tls != NULL; tls = tls->next)
- if ((tls->flags & (SEC_THREAD_LOCAL | SEC_LOAD))
- == (SEC_THREAD_LOCAL | SEC_LOAD))
- break;
-- if (tls == NULL)
-- return TRUE;
-
- htab = ppc_hash_table (info);
- htab->tls_sec = tls;
-+ return tls != NULL;
-+}
-
-- if (info->shared)
-+/* Run through all the TLS relocs looking for optimization
-+ opportunities. The linker has been hacked (see ppc64elf.em) to do
-+ a preliminary section layout so that we know the TLS segment
-+ offsets. We can't optimize earlier because some optimizations need
-+ to know the tp offset, and we need to optimize before allocating
-+ dynamic relocations. */
-+
-+bfd_boolean
-+ppc64_elf_tls_optimize (obfd, info)
-+ bfd *obfd ATTRIBUTE_UNUSED;
-+ struct bfd_link_info *info;
-+{
-+ bfd *ibfd;
-+ asection *sec;
-+ struct ppc_link_hash_table *htab;
-+
-+ if (info->relocateable || info->shared)
- return TRUE;
-
-+ htab = ppc_hash_table (info);
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
- {
- Elf_Internal_Sym *locsyms = NULL;
-@@ -5172,7 +5213,7 @@ ppc64_elf_tls_optimize (obfd, info)
- char *tls_type;
- char tls_set, tls_clear, got_tls_type = 0;
- bfd_vma value;
-- bfd_boolean ok_tprel;
-+ bfd_boolean ok_tprel, is_local;
-
- r_symndx = ELF64_R_SYM (rel->r_info);
- if (!get_sym_h (&h, &sym, &sym_sec, &tls_type, &locsyms,
-@@ -5197,9 +5238,13 @@ ppc64_elf_tls_optimize (obfd, info)
- }
- else
- value = sym->st_value;
-+
- ok_tprel = FALSE;
-- if (sym_sec != NULL && sym_sec->output_section != NULL)
-+ is_local = FALSE;
-+ if (h == NULL
-+ || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
- {
-+ is_local = TRUE;
- value += sym_sec->output_offset;
- value += sym_sec->output_section->vma;
- value -= htab->tls_sec->vma;
-@@ -5215,16 +5260,17 @@ ppc64_elf_tls_optimize (obfd, info)
- case R_PPC64_GOT_TLSLD16_LO:
- case R_PPC64_GOT_TLSLD16_HI:
- case R_PPC64_GOT_TLSLD16_HA:
-+ /* These relocs should never be against a symbol
-+ defined in a shared lib. Leave them alone if
-+ that turns out to be the case. */
-+ if (!is_local)
-+ continue;
-+
- htab->tlsld_got.refcount -= 1;
-- if (ok_tprel)
-- /* LD -> LE */
-- tls_set = 0;
-- else
-- /* We still need a GOT entry as the offset is
-- too big. ie. LD -> IE. */
-- tls_set = TLS_TLS | TLS_TPREL;
-- tls_clear = TLS_GD_LD;
-- got_tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
-+ /* LD -> LE */
-+ tls_set = 0;
-+ tls_clear = TLS_LD;
-+ got_tls_type = TLS_TLS | TLS_LD;
- expecting_tls_get_addr = 1;
- break;
-
-@@ -5232,21 +5278,14 @@ ppc64_elf_tls_optimize (obfd, info)
- case R_PPC64_GOT_TLSGD16_LO:
- case R_PPC64_GOT_TLSGD16_HI:
- case R_PPC64_GOT_TLSGD16_HA:
-- if (ok_tprel
-- && (h == NULL
-- || ((h->elf_link_hash_flags
-- & ELF_LINK_HASH_DEF_REGULAR) != 0
-- && ((h->elf_link_hash_flags
-- & ELF_LINK_FORCED_LOCAL) != 0
-- || !info->shared
-- || info->symbolic))))
-+ if (ok_tprel)
- /* GD -> LE */
- tls_set = 0;
- else
- /* GD -> IE */
-- tls_set = TLS_TLS | TLS_TPREL;
-- tls_clear = TLS_GD_LD;
-- got_tls_type = TLS_TLS | TLS_GD_LD;
-+ tls_set = TLS_TLS | TLS_TPRELGD;
-+ tls_clear = TLS_GD;
-+ got_tls_type = TLS_TLS | TLS_GD;
- expecting_tls_get_addr = 1;
- break;
-
-@@ -5282,12 +5321,14 @@ ppc64_elf_tls_optimize (obfd, info)
- {
- /* Check for toc tls entries. */
- char *toc_tls;
-+ int retval;
-
-- if (!get_tls_type (&toc_tls, &locsyms,
-- rel - 1, ibfd))
-+ retval = get_tls_type (&toc_tls, &locsyms,
-+ rel - 1, ibfd);
-+ if (retval == 0)
- goto err_free_rel;
- if (toc_tls != NULL)
-- expecting_tls_get_addr = *toc_tls != 0;
-+ expecting_tls_get_addr = retval > 1;
- }
-
- if (expecting_tls_get_addr)
-@@ -5319,32 +5360,27 @@ ppc64_elf_tls_optimize (obfd, info)
-
- case R_PPC64_DTPMOD64:
- expecting_tls_get_addr = 0;
-- if ((*tls_type & TLS_LD) == 0)
-+ if (rel + 1 < relend
-+ && (rel[1].r_info
-+ == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
-+ && rel[1].r_offset == rel->r_offset + 8)
- {
-- if ((h == NULL
-- || ((h->elf_link_hash_flags
-- & ELF_LINK_HASH_DEF_REGULAR) != 0
-- && ((h->elf_link_hash_flags
-- & ELF_LINK_FORCED_LOCAL) != 0
-- || !info->shared
-- || info->symbolic)))
-- && ok_tprel)
-+ if (ok_tprel)
- /* GD -> LE */
-- tls_set = TLS_EXPLICIT;
-+ tls_set = TLS_EXPLICIT | TLS_GD;
- else
- /* GD -> IE */
-- tls_set = TLS_EXPLICIT | TLS_TPREL;
-- tls_clear = TLS_GD_LD;
-+ tls_set = TLS_EXPLICIT | TLS_GD | TLS_TPRELGD;
-+ tls_clear = TLS_GD;
- }
- else
- {
-- if (ok_tprel)
-- /* LD -> LE */
-- tls_set = TLS_EXPLICIT;
-- else
-- /* LD -> IE */
-- tls_set = TLS_EXPLICIT | TLS_TPREL;
-- tls_clear = TLS_GD_LD;
-+ if (!is_local)
-+ continue;
-+
-+ /* LD -> LE */
-+ tls_set = TLS_EXPLICIT;
-+ tls_clear = TLS_LD;
- }
- break;
-
-@@ -5376,8 +5412,6 @@ ppc64_elf_tls_optimize (obfd, info)
- if (ent->got.refcount > 0)
- ent->got.refcount -= 1;
- }
-- else
-- ent->tls_type = tls_set;
- }
- else if (h != NULL)
- {
-@@ -5395,14 +5429,9 @@ ppc64_elf_tls_optimize (obfd, info)
- /* If we got rid of a DTPMOD/DTPREL reloc
- pair then we'll lose one or two dyn
- relocs. */
-- if (tls_clear == TLS_GD_LD
-- && rel + 1 < relend
-- && (rel[1].r_info
-- == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
-- && rel[1].r_offset == rel->r_offset + 8)
-- p->count -= 1;
-- if (tls_set == TLS_EXPLICIT)
-+ if (tls_set == (TLS_EXPLICIT | TLS_GD))
- p->count -= 1;
-+ p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
-@@ -5515,11 +5544,39 @@ allocate_dynrelocs (h, inf)
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
- }
-
-+ eh = (struct ppc_link_hash_entry *) h;
-+ /* Run through the TLS GD got entries first if we're changing them
-+ to TPREL. */
-+ if ((eh->tls_type & TLS_TPRELGD) != 0)
-+ for (gent = h->got.glist; gent != NULL; gent = gent->next)
-+ if (gent->got.refcount > 0
-+ && (gent->tls_type & TLS_GD) != 0)
-+ {
-+ /* This was a GD entry that has been converted to TPREL. If
-+ there happens to be a TPREL entry we can use that one. */
-+ struct got_entry *ent;
-+ for (ent = h->got.glist; ent != NULL; ent = ent->next)
-+ if (ent->got.refcount > 0
-+ && (ent->tls_type & TLS_TPREL) != 0
-+ && ent->addend == gent->addend)
-+ {
-+ gent->got.refcount = 0;
-+ break;
-+ }
-+
-+ /* If not, then we'll be using our own TPREL entry. */
-+ if (gent->got.refcount != 0)
-+ gent->tls_type = TLS_TLS | TLS_TPREL;
-+ }
-+
- for (gent = h->got.glist; gent != NULL; gent = gent->next)
- if (gent->got.refcount > 0)
- {
-+ bfd_boolean dyn;
-+
- /* Make sure this symbol is output as a dynamic symbol.
-- Undefined weak syms won't yet be marked as dynamic. */
-+ Undefined weak syms won't yet be marked as dynamic,
-+ nor will all TLS symbols. */
- if (h->dynindx == -1
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
- {
-@@ -5528,26 +5585,24 @@ allocate_dynrelocs (h, inf)
- }
-
- if ((gent->tls_type & TLS_LD) != 0)
-- gent->got.offset = htab->tlsld_got.offset;
-- else
- {
-- bfd_boolean dyn;
--
-- s = htab->sgot;
-- gent->got.offset = s->_raw_size;
-- s->_raw_size += (gent->tls_type & TLS_GD_LD) != 0 ? 16 : 8;
-- dyn = htab->elf.dynamic_sections_created;
-- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
-- htab->srelgot->_raw_size
-- += ((gent->tls_type & TLS_GD_LD) != 0
-- ? 2 * sizeof (Elf64_External_Rela)
-- : sizeof (Elf64_External_Rela));
-+ gent->got.offset = htab->tlsld_got.offset;
-+ continue;
- }
-+
-+ s = htab->sgot;
-+ gent->got.offset = s->_raw_size;
-+ s->_raw_size += (gent->tls_type & eh->tls_type & TLS_GD) ? 16 : 8;
-+ dyn = htab->elf.dynamic_sections_created;
-+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
-+ htab->srelgot->_raw_size
-+ += (gent->tls_type & eh->tls_type & TLS_GD
-+ ? 2 * sizeof (Elf64_External_Rela)
-+ : sizeof (Elf64_External_Rela));
- }
- else
- gent->got.offset = (bfd_vma) -1;
-
-- eh = (struct ppc_link_hash_entry *) h;
- if (eh->dyn_relocs == NULL)
- return TRUE;
-
-@@ -5697,6 +5752,7 @@ ppc64_elf_size_dynamic_sections (output_
- {
- struct got_entry **lgot_ents;
- struct got_entry **end_lgot_ents;
-+ char *lgot_types;
- bfd_size_type locsymcount;
- Elf_Internal_Shdr *symtab_hdr;
- asection *srel;
-@@ -5738,16 +5794,17 @@ ppc64_elf_size_dynamic_sections (output_
- symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
- locsymcount = symtab_hdr->sh_info;
- end_lgot_ents = lgot_ents + locsymcount;
-+ lgot_types = (char *) end_lgot_ents;
- s = htab->sgot;
- srel = htab->srelgot;
-- for (; lgot_ents < end_lgot_ents; ++lgot_ents)
-+ for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_types)
- {
- struct got_entry *ent;
-
- for (ent = *lgot_ents; ent != NULL; ent = ent->next)
- if (ent->got.refcount > 0)
- {
-- if ((ent->tls_type & TLS_LD) != 0)
-+ if ((ent->tls_type & *lgot_types & TLS_LD) != 0)
- {
- if (htab->tlsld_got.offset == (bfd_vma) -1)
- {
-@@ -5761,7 +5818,7 @@ ppc64_elf_size_dynamic_sections (output_
- else
- {
- ent->got.offset = s->_raw_size;
-- if ((ent->tls_type & TLS_GD_LD) != 0)
-+ if ((ent->tls_type & *lgot_types & TLS_GD) != 0)
- {
- s->_raw_size += 16;
- if (info->shared)
-@@ -6608,8 +6665,7 @@ ppc64_elf_size_stubs (output_bfd, stub_b
- if (!get_tls_type (&tls_type, &local_syms,
- irela - 1, input_bfd))
- goto error_ret_free_internal;
-- if (tls_type != NULL
-- && (*tls_type & (TLS_TLS | TLS_GD_LD)) == TLS_TLS)
-+ if (*tls_type != 0)
- continue;
- }
-
-@@ -6902,7 +6958,6 @@ ppc64_elf_relocate_section (output_bfd,
- Elf_Internal_Rela *relend;
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
-- unsigned int tls_get_addr_type;
- struct got_entry **local_got_ents;
- bfd_vma TOCstart;
- bfd_boolean ret = TRUE;
-@@ -6938,7 +6993,6 @@ ppc64_elf_relocate_section (output_bfd,
- sym_hashes = elf_sym_hashes (input_bfd);
- is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL;
-
-- tls_get_addr_type = 0;
- rel = relocs;
- relend = relocs + input_section->reloc_count;
- for (; rel < relend; rel++)
-@@ -6952,7 +7006,7 @@ ppc64_elf_relocate_section (output_bfd,
- struct elf_link_hash_entry *fdh;
- const char *sym_name;
- unsigned long r_symndx;
-- char tls_type;
-+ char tls_mask, tls_gd, tls_type;
- bfd_vma relocation;
- bfd_boolean unresolved_reloc;
- bfd_boolean warned;
-@@ -7035,17 +7089,21 @@ ppc64_elf_relocate_section (output_bfd,
- }
- }
-
-- /* TLS optimizations. */
-- tls_type = 0;
-+ /* TLS optimizations. Replace instruction sequences and relocs
-+ based on information we collected in tls_optimize. We edit
-+ RELOCS so that --emit-relocs will output something sensible
-+ for the final instruction stream. */
-+ tls_mask = 0;
-+ tls_gd = 0;
- if (IS_TLS_RELOC (r_type))
- {
- if (h != NULL)
-- tls_type = ((struct ppc_link_hash_entry *) h)->tls_type;
-+ tls_mask = ((struct ppc_link_hash_entry *) h)->tls_type;
- else if (local_got_ents != NULL)
- {
- char *lgot_types;
- lgot_types = (char *) (local_got_ents + symtab_hdr->sh_info);
-- tls_type = lgot_types[r_symndx];
-+ tls_mask = lgot_types[r_symndx];
- }
- }
-
-@@ -7064,39 +7122,52 @@ ppc64_elf_relocate_section (output_bfd,
- switch (r_type)
- {
- default:
-- tls_get_addr_type = 0;
- break;
-
- case R_PPC64_TOC16:
- case R_PPC64_TOC16_LO:
- case R_PPC64_TOC16_DS:
- case R_PPC64_TOC16_LO_DS:
-- tls_get_addr_type = 0;
- {
- /* Check for toc tls entries. */
- char *toc_tls;
-+ int retval;
-
-- if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd))
-+ retval = get_tls_type (&toc_tls, &local_syms, rel, input_bfd);
-+ if (retval == 0)
- return FALSE;
-
- if (toc_tls)
- {
-- tls_type = *toc_tls;
-+ tls_mask = *toc_tls;
- if (r_type == R_PPC64_TOC16_DS
- || r_type == R_PPC64_TOC16_LO_DS)
- goto toctprel;
- else
-- tls_get_addr_type = tls_type;
-+ {
-+ /* If we found a GD reloc pair, then we might be
-+ doing a GD->IE transition. */
-+ if (retval == 2)
-+ {
-+ tls_gd = TLS_TPRELGD;
-+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
-+ goto tls_get_addr_check;
-+ }
-+ else if (retval == 3)
-+ {
-+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
-+ goto tls_get_addr_check;
-+ }
-+ }
- }
- }
- break;
-
- case R_PPC64_GOT_TPREL16_DS:
- case R_PPC64_GOT_TPREL16_LO_DS:
-- tls_get_addr_type = 0;
- toctprel:
-- if (tls_type != 0
-- && (tls_type & TLS_TPREL) == 0)
-+ if (tls_mask != 0
-+ && (tls_mask & TLS_TPREL) == 0)
- {
- bfd_vma insn;
- insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2);
-@@ -7109,8 +7180,7 @@ ppc64_elf_relocate_section (output_bfd,
- break;
-
- case R_PPC64_TLS:
-- tls_get_addr_type = 0;
-- if (tls_type == 0)
-+ if (tls_mask == 0)
- {
- /* Check for toc tls entries. */
- char *toc_tls;
-@@ -7119,10 +7189,10 @@ ppc64_elf_relocate_section (output_bfd,
- return FALSE;
-
- if (toc_tls)
-- tls_type = *toc_tls;
-+ tls_mask = *toc_tls;
- }
-- if (tls_type != 0
-- && (tls_type & TLS_TPREL) == 0)
-+ if (tls_mask != 0
-+ && (tls_mask & TLS_TPREL) == 0)
- {
- bfd_vma insn, rtra;
- insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
-@@ -7164,130 +7234,162 @@ ppc64_elf_relocate_section (output_bfd,
- }
- break;
-
-- case R_PPC64_GOT_TLSGD16:
-- case R_PPC64_GOT_TLSGD16_LO:
- case R_PPC64_GOT_TLSGD16_HI:
- case R_PPC64_GOT_TLSGD16_HA:
-- case R_PPC64_GOT_TLSLD16:
-- case R_PPC64_GOT_TLSLD16_LO:
-+ tls_gd = TLS_TPRELGD;
-+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
-+ goto tls_gdld_hi;
-+ break;
-+
- case R_PPC64_GOT_TLSLD16_HI:
- case R_PPC64_GOT_TLSLD16_HA:
-- tls_get_addr_type = 0;
-- if (tls_type != 0 && (tls_type & TLS_GD_LD) == 0)
-+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
- {
-- if (r_type == R_PPC64_GOT_TLSGD16_HI
-- || r_type == R_PPC64_GOT_TLSGD16_HA
-- || r_type == R_PPC64_GOT_TLSLD16_HI
-- || r_type == R_PPC64_GOT_TLSLD16_HA)
-+ tls_gdld_hi:
-+ if ((tls_mask & tls_gd) != 0)
-+ r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
-+ + R_PPC64_GOT_TPREL16_DS);
-+ else
- {
-- if ((tls_type & TLS_LD) != 0)
-- {
-- bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
-- r_type = R_PPC64_NONE;
-- rel->r_offset -= 2;
-- }
-- else
-- r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
-- + R_PPC64_GOT_TPREL16_DS);
-- rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-- break;
-+ bfd_put_32 (output_bfd, NOP, contents + rel->r_offset);
-+ rel->r_offset -= 2;
-+ r_type = R_PPC64_NONE;
- }
--
-- /* This reloc and its instruction will be replaced so there's
-- not much point in doing anything more here. We know the
-- next reloc will be a REL24 to __tls_get_addr, and will
-- be handled below. */
-- tls_get_addr_type = tls_type;
-- continue;
-+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
- }
- break;
-
-- case R_PPC64_REL14:
-- case R_PPC64_REL14_BRTAKEN:
-- case R_PPC64_REL14_BRNTAKEN:
-- case R_PPC64_REL24:
-- if (h != NULL
-- && h == htab->tls_get_addr
-- && tls_get_addr_type != 0
-- && (tls_get_addr_type & TLS_GD_LD) == 0)
-- {
-- /* Replace the call. */
-- bfd_vma insn1, insn2, insn3;
-- bfd_vma offset = rel->r_offset;
--
-- insn1 = bfd_get_32 (output_bfd, contents + rel[-1].r_offset - 2);
-- insn3 = bfd_get_32 (output_bfd, contents + offset + 4);
-- if (tls_get_addr_type & TLS_TPREL)
-- {
-- /* IE */
-- insn1 &= (1 << 26) - (1 << 2);
-- insn1 |= 58 << 26; /* ld */
-- insn2 = 0x7c636a14; /* add 3,3,13 */
-- /* Fix the relocs for --emit-relocs. */
-- r_type = ELF64_R_TYPE (rel[-1].r_info);
-- if (tls_get_addr_type & TLS_EXPLICIT)
-- r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16;
-- else
-- r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
-- + R_PPC64_GOT_TPREL16_DS);
-- rel[-1].r_info
-- = ELF64_R_INFO (ELF64_R_SYM (rel[-1].r_info), r_type);
-- rel->r_info = 0;
-- }
-- else
-+ case R_PPC64_GOT_TLSGD16:
-+ case R_PPC64_GOT_TLSGD16_LO:
-+ tls_gd = TLS_TPRELGD;
-+ if (tls_mask != 0 && (tls_mask & TLS_GD) == 0)
-+ goto tls_get_addr_check;
-+ break;
-+
-+ case R_PPC64_GOT_TLSLD16:
-+ case R_PPC64_GOT_TLSLD16_LO:
-+ if (tls_mask != 0 && (tls_mask & TLS_LD) == 0)
-+ {
-+ tls_get_addr_check:
-+ if (rel + 1 < relend)
- {
-- /* LE */
-- insn1 = 0x3c6d0000; /* addis 3,13,0 */
-- insn2 = 0x38630000; /* addi 3,3,0 */
-- if (tls_get_addr_type & TLS_LD)
-+ enum elf_ppc64_reloc_type r_type2;
-+ unsigned long r_symndx2;
-+ struct elf_link_hash_entry *h2;
-+ bfd_vma insn1, insn2, insn3;
-+ bfd_vma offset;
-+
-+ /* The next instruction should be a call to
-+ __tls_get_addr. Peek at the reloc to be sure. */
-+ r_type2
-+ = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel[1].r_info);
-+ r_symndx2 = ELF64_R_SYM (rel[1].r_info);
-+ if (r_symndx2 < symtab_hdr->sh_info
-+ || (r_type2 != R_PPC64_REL14
-+ && r_type2 != R_PPC64_REL14_BRTAKEN
-+ && r_type2 != R_PPC64_REL14_BRNTAKEN
-+ && r_type2 != R_PPC64_REL24))
-+ break;
-+
-+ h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info];
-+ while (h2->root.type == bfd_link_hash_indirect
-+ || h2->root.type == bfd_link_hash_warning)
-+ h2 = (struct elf_link_hash_entry *) h2->root.u.i.link;
-+ if (h2 == NULL || h2 != htab->tls_get_addr)
-+ break;
-+
-+ /* OK, it checks out. Replace the call. */
-+ offset = rel[1].r_offset;
-+ insn1 = bfd_get_32 (output_bfd,
-+ contents + rel->r_offset - 2);
-+ insn3 = bfd_get_32 (output_bfd,
-+ contents + offset + 4);
-+ if ((tls_mask & tls_gd) != 0)
- {
-- r_symndx = 0;
-- rel[-1].r_addend = htab->tls_sec->vma + DTP_OFFSET;
-- rel->r_addend = htab->tls_sec->vma + DTP_OFFSET;
-+ /* IE */
-+ insn1 &= (1 << 26) - (1 << 2);
-+ insn1 |= 58 << 26; /* ld */
-+ insn2 = 0x7c636a14; /* add 3,3,13 */
-+ rel[1].r_info = ELF64_R_INFO (r_symndx2, R_PPC64_NONE);
-+ if ((tls_mask & TLS_EXPLICIT) == 0)
-+ r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
-+ + R_PPC64_GOT_TPREL16_DS);
-+ else
-+ r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16;
-+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
- }
- else
-- r_symndx = ELF64_R_SYM (rel[-1].r_info);
-- rel[-1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_HA);
-- rel->r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_LO);
-- rel->r_offset += 2;
-- }
-- if (insn3 == NOP
-- || insn3 == CROR_151515 || insn3 == CROR_313131)
-- {
-- insn3 = insn2;
-- insn2 = NOP;
-- rel->r_offset += 4;
-+ {
-+ /* LE */
-+ insn1 = 0x3c6d0000; /* addis 3,13,0 */
-+ insn2 = 0x38630000; /* addi 3,3,0 */
-+ if (tls_gd == 0)
-+ {
-+ /* Was an LD reloc. */
-+ r_symndx = 0;
-+ rel->r_addend = htab->tls_sec->vma + DTP_OFFSET;
-+ rel[1].r_addend = htab->tls_sec->vma + DTP_OFFSET;
-+ }
-+ r_type = R_PPC64_TPREL16_HA;
-+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-+ rel[1].r_info = ELF64_R_INFO (r_symndx,
-+ R_PPC64_TPREL16_LO);
-+ rel[1].r_offset += 2;
-+ }
-+ if (insn3 == NOP
-+ || insn3 == CROR_151515 || insn3 == CROR_313131)
-+ {
-+ insn3 = insn2;
-+ insn2 = NOP;
-+ rel[1].r_offset += 4;
-+ }
-+ bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
-+ bfd_put_32 (output_bfd, insn2, contents + offset);
-+ bfd_put_32 (output_bfd, insn3, contents + offset + 4);
-+ if (tls_gd == 0)
-+ {
-+ /* We changed the symbol on an LD reloc. Start over
-+ in order to get h, sym, sec etc. right. */
-+ rel--;
-+ continue;
-+ }
- }
-- bfd_put_32 (output_bfd, insn1, contents + rel[-1].r_offset - 2);
-- bfd_put_32 (output_bfd, insn2, contents + offset);
-- bfd_put_32 (output_bfd, insn3, contents + offset + 4);
-- /* Do the relocs again. */
-- rel -= 2;
-- tls_get_addr_type = 0;
-- continue;
- }
-- tls_get_addr_type = 0;
- break;
-
- case R_PPC64_DTPMOD64:
-- if ((tls_type & TLS_GD_LD) == 0)
-+ if (rel + 1 < relend
-+ && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)
-+ && rel[1].r_offset == rel->r_offset + 8)
- {
-- if ((tls_type & TLS_TPREL) != 0)
-- r_type = R_PPC64_TPREL64;
-- else
-+ if ((tls_mask & TLS_GD) == 0)
-+ {
-+ rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_NONE);
-+ if ((tls_mask & TLS_TPRELGD) != 0)
-+ r_type = R_PPC64_TPREL64;
-+ else
-+ {
-+ bfd_put_64 (output_bfd, (bfd_vma) 1,
-+ contents + rel->r_offset);
-+ r_type = R_PPC64_NONE;
-+ }
-+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-+ }
-+ }
-+ else
-+ {
-+ if ((tls_mask & TLS_LD) == 0)
- {
- bfd_put_64 (output_bfd, (bfd_vma) 1,
- contents + rel->r_offset);
- r_type = R_PPC64_NONE;
-+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
- }
-- rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-- if ((tls_type & TLS_LD) == 0)
-- rel[1].r_info = 0;
- }
- break;
-
- case R_PPC64_TPREL64:
-- if ((tls_type & TLS_TPREL) == 0)
-+ if ((tls_mask & TLS_TPREL) == 0)
- {
- r_type = R_PPC64_NONE;
- rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-@@ -7437,14 +7539,14 @@ ppc64_elf_relocate_section (output_bfd,
- case R_PPC64_GOT_TLSGD16_LO:
- case R_PPC64_GOT_TLSGD16_HI:
- case R_PPC64_GOT_TLSGD16_HA:
-- tls_type = TLS_TLS | TLS_GD_LD;
-+ tls_type = TLS_TLS | TLS_GD;
- goto dogot;
-
- case R_PPC64_GOT_TLSLD16:
- case R_PPC64_GOT_TLSLD16_LO:
- case R_PPC64_GOT_TLSLD16_HI:
- case R_PPC64_GOT_TLSLD16_HA:
-- tls_type = TLS_TLS | TLS_GD_LD | TLS_LD;
-+ tls_type = TLS_TLS | TLS_LD;
- goto dogot;
-
- case R_PPC64_GOT_TPREL16_DS:
-@@ -7530,12 +7632,12 @@ ppc64_elf_relocate_section (output_bfd,
- the case of TLSLD where we'll use one entry per
- module. */
- if ((info->shared || indx != 0)
-- && ent->tls_type != (TLS_TLS | TLS_GD_LD | TLS_LD))
-+ && tls_type != (TLS_TLS | TLS_LD))
- {
- outrel.r_offset = (htab->sgot->output_section->vma
- + htab->sgot->output_offset
- + off);
-- if (ent->tls_type == (TLS_TLS | TLS_GD_LD))
-+ if (tls_type == (TLS_TLS | TLS_GD))
- {
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64);
- outrel.r_addend = 0;
-@@ -7546,15 +7648,15 @@ ppc64_elf_relocate_section (output_bfd,
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
- outrel.r_offset += 8;
- }
-- else if (ent->tls_type == (TLS_TLS | TLS_DTPREL))
-+ else if (tls_type == (TLS_TLS | TLS_DTPREL))
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
-- else if (ent->tls_type == (TLS_TLS | TLS_TPREL))
-+ else if (tls_type == (TLS_TLS | TLS_TPREL))
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_TPREL64);
- else if (indx == 0)
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_RELATIVE);
- else
- outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT);
-- outrel.r_addend = ent->addend;
-+ outrel.r_addend = rel->r_addend;
- if (indx == 0)
- outrel.r_addend += relocation;
- loc = htab->srelgot->contents;
-@@ -7576,7 +7678,7 @@ ppc64_elf_relocate_section (output_bfd,
- relocation += DTP_OFFSET - TP_OFFSET;
- }
-
-- if ((tls_type & TLS_GD_LD) != 0)
-+ if ((tls_type & (TLS_GD | TLS_LD)) != 0)
- {
- if ((tls_type & TLS_LD) != 0)
- relocation = - DTP_OFFSET;
---- bfd/elf64-ppc.h 4 Feb 2003 14:50:50 -0000 1.7
-+++ bfd/elf64-ppc.h 9 Feb 2003 03:10:51 -0000
-@@ -21,6 +21,8 @@ bfd_boolean ppc64_elf_mark_entry_syms
- PARAMS ((struct bfd_link_info *));
- bfd_boolean ppc64_elf_edit_opd
- PARAMS ((bfd *, struct bfd_link_info *));
-+bfd_boolean ppc64_elf_tls_setup
-+ PARAMS ((bfd *, struct bfd_link_info *));
- bfd_boolean ppc64_elf_tls_optimize
- PARAMS ((bfd *, struct bfd_link_info *));
- bfd_vma ppc64_elf_toc
---- ld/emultempl/ppc64elf.em 4 Feb 2003 14:51:35 -0000 1.12
-+++ ld/emultempl/ppc64elf.em 9 Feb 2003 03:10:53 -0000
-@@ -41,6 +41,9 @@ static bfd_signed_vma group_size = 1;
- /* Whether to add ".foo" entries for each "foo" in a version script. */
- static int dotsyms = 1;
-
-+/* Whether to run tls optimization. */
-+static int notlsopt = 0;
-+
- static void ppc_create_output_section_statements
- PARAMS ((void));
- static void ppc_after_open
-@@ -101,20 +104,23 @@ ppc_before_allocation ()
- return;
- }
-
-- /* Size the sections. This is premature, but we want to know the
-- TLS segment layout so that certain optimizations can be done. */
-- lang_size_sections (stat_ptr->head, abs_output_section,
-- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
--
-- if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
-+ if (ppc64_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
- {
-- einfo ("%X%P: TLS problem %E\n");
-- return;
-+ /* Size the sections. This is premature, but we want to know the
-+ TLS segment layout so that certain optimizations can be done. */
-+ lang_size_sections (stat_ptr->head, abs_output_section,
-+ &stat_ptr->head, 0, (bfd_vma) 0, NULL);
-+
-+ if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
-+ {
-+ einfo ("%X%P: TLS problem %E\n");
-+ return;
-+ }
-+
-+ lang_reset_memory_regions ();
- }
-
- gld${EMULATION_NAME}_before_allocation ();
--
-- lang_reset_memory_regions ();
- }
-
- struct hook_stub_info
-@@ -457,6 +463,7 @@ PARSE_AND_LIST_PROLOGUE='
- #define OPTION_STUBGROUP_SIZE 301
- #define OPTION_DOTSYMS (OPTION_STUBGROUP_SIZE + 1)
- #define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1)
-+#define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1)
- '
-
- # The options are repeated below so that no abbreviations are allowed.
-@@ -468,6 +475,8 @@ PARSE_AND_LIST_LONGOPTS='
- { "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
- { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
- { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
-+ { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
-+ { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
- '
-
- PARSE_AND_LIST_OPTIONS='
-@@ -489,6 +498,9 @@ PARSE_AND_LIST_OPTIONS='
- fprintf (file, _("\
- --no-dotsyms Don'\''t do anything special in version scripts.\n"
- ));
-+ fprintf (file, _("\
-+ --no-tls-optimize Don'\''t try to optimize TLS accesses.\n"
-+ ));
- '
-
- PARSE_AND_LIST_ARGS_CASES='
-@@ -502,15 +514,15 @@ PARSE_AND_LIST_ARGS_CASES='
- break;
-
- case OPTION_DOTSYMS:
-- {
-- dotsyms = 1;
-- }
-+ dotsyms = 1;
- break;
-
- case OPTION_NO_DOTSYMS:
-- {
-- dotsyms = 0;
-- }
-+ dotsyms = 0;
-+ break;
-+
-+ case OPTION_NO_TLS_OPT:
-+ notlsopt = 1;
- break;
- '
-
---- ld/testsuite/ld-powerpc/tlsexe.d 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexe.d 9 Feb 2003 03:10:53 -0000
-@@ -8,42 +8,61 @@
-
- Disassembly of section \.text:
-
--0+10000378 <_start>:
-- 10000378: e8 62 80 10 ld r3,-32752\(r2\)
-- 1000037c: 60 00 00 00 nop
-- 10000380: 7c 63 6a 14 add r3,r3,r13
-- 10000384: e8 62 80 18 ld r3,-32744\(r2\)
-- 10000388: 60 00 00 00 nop
-- 1000038c: 7c 63 6a 14 add r3,r3,r13
-- 10000390: 3c 6d 00 00 addis r3,r13,0
-- 10000394: 60 00 00 00 nop
-- 10000398: 38 63 90 38 addi r3,r3,-28616
-- 1000039c: 3c 6d 00 00 addis r3,r13,0
-- 100003a0: 60 00 00 00 nop
-- 100003a4: 38 63 10 00 addi r3,r3,4096
-- 100003a8: 39 23 80 40 addi r9,r3,-32704
-- 100003ac: 3d 23 00 00 addis r9,r3,0
-- 100003b0: 81 49 80 48 lwz r10,-32696\(r9\)
-- 100003b4: e9 22 80 20 ld r9,-32736\(r2\)
-- 100003b8: 7d 49 18 2a ldx r10,r9,r3
-- 100003bc: 3d 2d 00 00 addis r9,r13,0
-- 100003c0: a1 49 90 58 lhz r10,-28584\(r9\)
-- 100003c4: 89 4d 90 60 lbz r10,-28576\(r13\)
-- 100003c8: 3d 2d 00 00 addis r9,r13,0
-- 100003cc: 99 49 90 68 stb r10,-28568\(r9\)
-+0+10000390 <_start-0x1c>:
-+ 10000390: 3d 82 00 00 addis r12,r2,0
-+ 10000394: f8 41 00 28 std r2,40\(r1\)
-+ 10000398: e9 6c 80 48 ld r11,-32696\(r12\)
-+ 1000039c: e8 4c 80 50 ld r2,-32688\(r12\)
-+ 100003a0: 7d 69 03 a6 mtctr r11
-+ 100003a4: e9 6c 80 58 ld r11,-32680\(r12\)
-+ 100003a8: 4e 80 04 20 bctr
-+
-+0+100003ac <_start>:
-+ 100003ac: e8 62 80 20 ld r3,-32736\(r2\)
-+ 100003b0: 60 00 00 00 nop
-+ 100003b4: 7c 63 6a 14 add r3,r3,r13
-+ 100003b8: 38 62 80 08 addi r3,r2,-32760
-+ 100003bc: 4b ff ff d5 bl 10000390 <le1\+0x10000328>
-+ 100003c0: e8 41 00 28 ld r2,40\(r1\)
-+ 100003c4: 3c 6d 00 00 addis r3,r13,0
-+ 100003c8: 60 00 00 00 nop
-+ 100003cc: 38 63 90 38 addi r3,r3,-28616
- 100003d0: 3c 6d 00 00 addis r3,r13,0
- 100003d4: 60 00 00 00 nop
-- 100003d8: 38 63 90 00 addi r3,r3,-28672
-- 100003dc: 3c 6d 00 00 addis r3,r13,0
-- 100003e0: 60 00 00 00 nop
-- 100003e4: 38 63 10 00 addi r3,r3,4096
-- 100003e8: f9 43 80 08 std r10,-32760\(r3\)
-- 100003ec: 3d 23 00 00 addis r9,r3,0
-- 100003f0: 91 49 80 10 stw r10,-32752\(r9\)
-- 100003f4: e9 22 80 08 ld r9,-32760\(r2\)
-- 100003f8: 7d 49 19 2a stdx r10,r9,r3
-+ 100003d8: 38 63 10 00 addi r3,r3,4096
-+ 100003dc: 39 23 80 40 addi r9,r3,-32704
-+ 100003e0: 3d 23 00 00 addis r9,r3,0
-+ 100003e4: 81 49 80 48 lwz r10,-32696\(r9\)
-+ 100003e8: e9 22 80 28 ld r9,-32728\(r2\)
-+ 100003ec: 7d 49 18 2a ldx r10,r9,r3
-+ 100003f0: 3d 2d 00 00 addis r9,r13,0
-+ 100003f4: a1 49 90 58 lhz r10,-28584\(r9\)
-+ 100003f8: 89 4d 90 60 lbz r10,-28576\(r13\)
- 100003fc: 3d 2d 00 00 addis r9,r13,0
-- 10000400: b1 49 90 58 sth r10,-28584\(r9\)
-- 10000404: e9 4d 90 2a lwa r10,-28632\(r13\)
-- 10000408: 3d 2d 00 00 addis r9,r13,0
-- 1000040c: a9 49 90 30 lha r10,-28624\(r9\)
-+ 10000400: 99 49 90 68 stb r10,-28568\(r9\)
-+ 10000404: 3c 6d 00 00 addis r3,r13,0
-+ 10000408: 60 00 00 00 nop
-+ 1000040c: 38 63 90 00 addi r3,r3,-28672
-+ 10000410: 3c 6d 00 00 addis r3,r13,0
-+ 10000414: 60 00 00 00 nop
-+ 10000418: 38 63 10 00 addi r3,r3,4096
-+ 1000041c: f9 43 80 08 std r10,-32760\(r3\)
-+ 10000420: 3d 23 00 00 addis r9,r3,0
-+ 10000424: 91 49 80 10 stw r10,-32752\(r9\)
-+ 10000428: e9 22 80 18 ld r9,-32744\(r2\)
-+ 1000042c: 7d 49 19 2a stdx r10,r9,r3
-+ 10000430: 3d 2d 00 00 addis r9,r13,0
-+ 10000434: b1 49 90 58 sth r10,-28584\(r9\)
-+ 10000438: e9 4d 90 2a lwa r10,-28632\(r13\)
-+ 1000043c: 3d 2d 00 00 addis r9,r13,0
-+ 10000440: a9 49 90 30 lha r10,-28624\(r9\)
-+ 10000444: e8 41 00 28 ld r2,40\(r1\)
-+ 10000448: 3d 82 00 00 addis r12,r2,0
-+ 1000044c: e9 6c 80 30 ld r11,-32720\(r12\)
-+ 10000450: e8 4c 80 38 ld r2,-32712\(r12\)
-+ 10000454: 7d 69 03 a6 mtctr r11
-+ 10000458: e9 6c 80 40 ld r11,-32704\(r12\)
-+ 1000045c: 4e 80 04 20 bctr
-+ 10000460: 60 00 00 00 nop
-+ 10000464: 38 00 00 00 li r0,0
-+ 10000468: 4b ff ff dc b 10000444 <_start\+0x98>
---- ld/testsuite/ld-powerpc/tlsexe.g 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexe.g 9 Feb 2003 03:10:53 -0000
-@@ -7,6 +7,6 @@
- .*: +file format elf64-powerpc
-
- Contents of section \.got:
-- 10010548 00000000 10018548 ffffffff ffff8018 .*
-- 10010558 00000000 00000000 00000000 00000000 .*
-- 10010568 00000000 00000000 .*
-+ 100105f8 00000000 100185f8 00000000 00000000 .*
-+ 10010608 00000000 00000000 ffffffff ffff8018 .*
-+ 10010618 00000000 00000000 00000000 00000000 .*
---- ld/testsuite/ld-powerpc/tlsexe.r 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexe.r 9 Feb 2003 03:10:53 -0000
-@@ -1,38 +1,40 @@
- #source: tls.s
- #source: tlslib.s
- #as: -a64
--#ld: -shared -melf64ppc
-+#ld: -melf64ppc
- #readelf: -WSsrl
- #target: powerpc64*-*-*
-
--There are 20 section headers.*
-+There are 22 section headers.*
-
- Section Headers:
- +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
- +\[ 0\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0
- +\[ 1\] \.interp +PROGBITS +0+10000190 0+190 0+11 0+ +A +0 +0 +1
-- +\[ 2\] \.hash +HASH +0+100001a8 0+1a8 0+3c 04 +A +3 +0 +8
-- +\[ 3\] \.dynsym +DYNSYM +0+100001e8 0+1e8 0+f0 18 +A +4 +1 +8
-- +\[ 4\] \.dynstr +STRTAB +0+100002d8 0+2d8 0+51 0+ +A +0 +0 +1
-- +\[ 5\] \.rela\.dyn +RELA +0+10000330 0+330 0+48 18 +A +3 +0 +8
-- +\[ 6\] \.text +PROGBITS +0+10000378 0+378 0+98 0+ +AX +0 +0 +4
-- +\[ 7\] \.data +PROGBITS +0+10010410 0+410 0+ 0+ +WA +0 +0 +1
-- +\[ 8\] \.branch_lt +PROGBITS +0+10010410 0+410 0+ 0+ +WA +0 +0 +8
-- +\[ 9\] \.tdata +PROGBITS +0+10010410 0+410 0+38 0+ WAT +0 +0 +8
-- +\[10\] \.tbss +NOBITS +0+10010448 0+448 0+38 0+ WAT +0 +0 +8
-- +\[11\] \.dynamic +DYNAMIC +0+10010448 0+448 0+100 10 +WA +4 +0 +8
-- +\[12\] \.ctors +PROGBITS +0+10010548 0+570 0+ 0+ +W +0 +0 +1
-- +\[13\] \.dtors +PROGBITS +0+10010548 0+570 0+ 0+ +W +0 +0 +1
-- +\[14\] \.got +PROGBITS +0+10010548 0+548 0+28 08 +WA +0 +0 +8
-- +\[15\] \.sbss +PROGBITS +0+10010570 0+570 0+ 0+ +W +0 +0 +1
-- +\[16\] \.bss +NOBITS +0+10010570 0+570 0+ 0+ +WA +0 +0 +1
-- +\[17\] \.shstrtab +STRTAB +0+ 0+570 0+8e 0+ +0 +0 +1
-- +\[18\] \.symtab +SYMTAB +0+ 0+b00 0+408 18 +19 +1b +8
-- +\[19\] \.strtab +STRTAB +0+ 0+f08 0+7d 0+ +0 +0 +1
-+ +\[ 2\] \.hash +HASH +0+100001a8 0+1a8 0+40 04 +A +3 +0 +8
-+ +\[ 3\] \.dynsym +DYNSYM +0+100001e8 0+1e8 0+108 18 +A +4 +1 +8
-+ +\[ 4\] \.dynstr +STRTAB +0+100002f0 0+2f0 0+51 0+ +A +0 +0 +1
-+ +\[ 5\] \.rela\.dyn +RELA +0+10000348 0+348 0+30 18 +A +3 +0 +8
-+ +\[ 6\] \.rela\.plt +RELA +0+10000378 0+378 0+18 18 +A +3 +11 +8
-+ +\[ 7\] \.text +PROGBITS +0+10000390 0+390 0+dc 0+ +AX +0 +0 +4
-+ +\[ 8\] \.data +PROGBITS +0+10010470 0+470 0+ 0+ +WA +0 +0 +1
-+ +\[ 9\] \.branch_lt +PROGBITS +0+10010470 0+470 0+ 0+ +WA +0 +0 +8
-+ +\[10\] \.tdata +PROGBITS +0+10010470 0+470 0+38 0+ WAT +0 +0 +8
-+ +\[11\] \.tbss +NOBITS +0+100104a8 0+4a8 0+38 0+ WAT +0 +0 +8
-+ +\[12\] \.dynamic +DYNAMIC +0+100104a8 0+4a8 0+150 10 +WA +4 +0 +8
-+ +\[13\] \.ctors +PROGBITS +0+100105f8 0+628 0+ 0+ +W +0 +0 +1
-+ +\[14\] \.dtors +PROGBITS +0+100105f8 0+628 0+ 0+ +W +0 +0 +1
-+ +\[15\] \.got +PROGBITS +0+100105f8 0+5f8 0+30 08 +WA +0 +0 +8
-+ +\[16\] \.sbss +PROGBITS +0+10010628 0+628 0+ 0+ +W +0 +0 +1
-+ +\[17\] \.plt +NOBITS +0+10010628 0+628 0+30 18 +WA +0 +0 +8
-+ +\[18\] \.bss +NOBITS +0+10010658 0+628 0+ 0+ +WA +0 +0 +1
-+ +\[19\] \.shstrtab +STRTAB +0+ 0+628 0+98 0+ +0 +0 +1
-+ +\[20\] \.symtab +SYMTAB +0+ 0+c40 0+450 18 +21 +1d +8
-+ +\[21\] \.strtab +STRTAB +0+ 0+1090 0+8c 0+ +0 +0 +1
- #...
-
- Elf file type is EXEC \(Executable file\)
--Entry point 0x10000378
-+Entry point 0x100003ac
- There are 6 program headers.*
-
- Program Headers:
-@@ -40,81 +42,88 @@ Program Headers:
- +PHDR +0x0+40 0x0+10000040 0x0+10000040 0x0+150 0x0+150 R E 0x8
- +INTERP +0x0+190 0x0+10000190 0x0+10000190 0x0+11 0x0+11 R +0x1
- +\[Requesting program interpreter: .*\]
-- +LOAD +0x0+ 0x0+10000000 0x0+10000000 0x0+410 0x0+410 R E 0x10000
-- +LOAD +0x0+410 0x0+10010410 0x0+10010410 0x0+160 0x0+160 RW +0x10000
-- +DYNAMIC +0x0+448 0x0+10010448 0x0+10010448 0x0+100 0x0+100 RW +0x8
-- +TLS +0x0+410 0x0+10010410 0x0+10010410 0x0+38 0x0+70 R +0x8
-+ +LOAD +0x0+ 0x0+10000000 0x0+10000000 0x0+46c 0x0+46c R E 0x10000
-+ +LOAD +0x0+470 0x0+10010470 0x0+10010470 0x0+1b8 0x0+1e8 RW +0x10000
-+ +DYNAMIC +0x0+4a8 0x0+100104a8 0x0+100104a8 0x0+150 0x0+150 RW +0x8
-+ +TLS +0x0+470 0x0+10010470 0x0+10010470 0x0+38 0x0+70 R +0x8
-
- Section to Segment mapping:
- +Segment Sections\.\.\.
-- +00 +
-+ +0+ +
- +01 +\.interp
-- +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.text
-- +03 +\.tdata \.tbss \.dynamic \.got
-+ +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text
-+ +03 +\.tdata \.tbss \.dynamic \.got \.plt
- +04 +\.tbss \.dynamic
- +05 +\.tdata \.tbss
-
--Relocation section '\.rela\.dyn' at offset .* contains 3 entries:
-+Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
- +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
--0+10010558 +0+200000049 R_PPC64_TPREL64 +0+ gd \+ 0
--0+10010560 +0+400000049 R_PPC64_TPREL64 +0+ ld \+ 0
--0+10010568 +0+60000004e R_PPC64_DTPREL64 +0+50 ld2 \+ 0
-+0+10010618 +0+200000049 R_PPC64_TPREL64 +0+ gd \+ 0
-+0+10010620 +0+70000004e R_PPC64_DTPREL64 +0+50 ld2 \+ 0
-
--Symbol table '\.dynsym' contains 10 entries:
-+Relocation section '\.rela\.plt' at offset .* contains 1 entries:
-+ +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-+0+10010640 +0+300000015 R_PPC64_JMP_SLOT +0+ __tls_get_addr \+ 0
-+
-+Symbol table '\.dynsym' contains 11 entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND
-- +1: 0+10010448 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-+ +1: 0+100104a8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +2: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-- +3: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND \.__tls_get_addr
-- +4: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-- +5: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-- +6: 0+50 +0 TLS +GLOBAL DEFAULT +10 ld2
-- +7: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-- +8: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-- +9: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-+ +3: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
-+ +4: 0+ +0 FUNC +GLOBAL DEFAULT +UND \.__tls_get_addr
-+ +5: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-+ +6: 0+10010658 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-+ +7: 0+50 +0 TLS +GLOBAL DEFAULT +11 ld2
-+ +8: 0+10010628 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-+ +9: 0+10010628 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-+ +10: 0+10010658 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-
--Symbol table '\.symtab' contains 43 entries:
-+Symbol table '\.symtab' contains 46 entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND
- +1: 0+10000190 +0 SECTION LOCAL +DEFAULT +1
- +2: 0+100001a8 +0 SECTION LOCAL +DEFAULT +2
- +3: 0+100001e8 +0 SECTION LOCAL +DEFAULT +3
-- +4: 0+100002d8 +0 SECTION LOCAL +DEFAULT +4
-- +5: 0+10000330 +0 SECTION LOCAL +DEFAULT +5
-+ +4: 0+100002f0 +0 SECTION LOCAL +DEFAULT +4
-+ +5: 0+10000348 +0 SECTION LOCAL +DEFAULT +5
- +6: 0+10000378 +0 SECTION LOCAL +DEFAULT +6
-- +7: 0+10010410 +0 SECTION LOCAL +DEFAULT +7
-- +8: 0+10010410 +0 SECTION LOCAL +DEFAULT +8
-- +9: 0+10010410 +0 SECTION LOCAL +DEFAULT +9
-- +10: 0+10010448 +0 SECTION LOCAL +DEFAULT +10
-- +11: 0+10010448 +0 SECTION LOCAL +DEFAULT +11
-- +12: 0+10010548 +0 SECTION LOCAL +DEFAULT +12
-- +13: 0+10010548 +0 SECTION LOCAL +DEFAULT +13
-- +14: 0+10010548 +0 SECTION LOCAL +DEFAULT +14
-- +15: 0+10010570 +0 SECTION LOCAL +DEFAULT +15
-- +16: 0+10010570 +0 SECTION LOCAL +DEFAULT +16
-- +17: 0+ +0 SECTION LOCAL +DEFAULT +17
-- +18: 0+ +0 SECTION LOCAL +DEFAULT +18
-+ +7: 0+10000390 +0 SECTION LOCAL +DEFAULT +7
-+ +8: 0+10010470 +0 SECTION LOCAL +DEFAULT +8
-+ +9: 0+10010470 +0 SECTION LOCAL +DEFAULT +9
-+ +10: 0+10010470 +0 SECTION LOCAL +DEFAULT +10
-+ +11: 0+100104a8 +0 SECTION LOCAL +DEFAULT +11
-+ +12: 0+100104a8 +0 SECTION LOCAL +DEFAULT +12
-+ +13: 0+100105f8 +0 SECTION LOCAL +DEFAULT +13
-+ +14: 0+100105f8 +0 SECTION LOCAL +DEFAULT +14
-+ +15: 0+100105f8 +0 SECTION LOCAL +DEFAULT +15
-+ +16: 0+10010628 +0 SECTION LOCAL +DEFAULT +16
-+ +17: 0+10010628 +0 SECTION LOCAL +DEFAULT +17
-+ +18: 0+10010658 +0 SECTION LOCAL +DEFAULT +18
- +19: 0+ +0 SECTION LOCAL +DEFAULT +19
-- +20: 0+ +0 TLS +LOCAL +DEFAULT +9 gd4
-- +21: 0+8 +0 TLS +LOCAL +DEFAULT +9 ld4
-- +22: 0+10 +0 TLS +LOCAL +DEFAULT +9 ld5
-- +23: 0+18 +0 TLS +LOCAL +DEFAULT +9 ld6
-- +24: 0+20 +0 TLS +LOCAL +DEFAULT +9 ie4
-- +25: 0+28 +0 TLS +LOCAL +DEFAULT +9 le4
-- +26: 0+30 +0 TLS +LOCAL +DEFAULT +9 le5
-- +27: 0+10010448 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-- +28: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-- +29: 0+60 +0 TLS +GLOBAL DEFAULT +10 le0
-- +30: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND \.__tls_get_addr
-- +31: 0+40 +0 TLS +GLOBAL DEFAULT +10 ld0
-- +32: 0+68 +0 TLS +GLOBAL DEFAULT +10 le1
-- +33: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-- +34: 0+10000378 +0 NOTYPE +GLOBAL DEFAULT +6 _start
-- +35: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-- +36: 0+50 +0 TLS +GLOBAL DEFAULT +10 ld2
-- +37: 0+48 +0 TLS +GLOBAL DEFAULT +10 ld1
-- +38: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-- +39: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-- +40: 0+10010570 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-- +41: 0+38 +0 TLS +GLOBAL DEFAULT +10 gd0
-- +42: 0+58 +0 TLS +GLOBAL DEFAULT +10 ie0
-+ +20: 0+ +0 SECTION LOCAL +DEFAULT +20
-+ +21: 0+ +0 SECTION LOCAL +DEFAULT +21
-+ +22: 0+ +0 TLS +LOCAL +DEFAULT +10 gd4
-+ +23: 0+8 +0 TLS +LOCAL +DEFAULT +10 ld4
-+ +24: 0+10 +0 TLS +LOCAL +DEFAULT +10 ld5
-+ +25: 0+18 +0 TLS +LOCAL +DEFAULT +10 ld6
-+ +26: 0+20 +0 TLS +LOCAL +DEFAULT +10 ie4
-+ +27: 0+28 +0 TLS +LOCAL +DEFAULT +10 le4
-+ +28: 0+30 +0 TLS +LOCAL +DEFAULT +10 le5
-+ +29: 0+100104a8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-+ +30: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-+ +31: 0+60 +0 TLS +GLOBAL DEFAULT +11 le0
-+ +32: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
-+ +33: 0+ +0 FUNC +GLOBAL DEFAULT +UND \.__tls_get_addr
-+ +34: 0+40 +0 TLS +GLOBAL DEFAULT +11 ld0
-+ +35: 0+68 +0 TLS +GLOBAL DEFAULT +11 le1
-+ +36: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-+ +37: 0+100003ac +0 NOTYPE +GLOBAL DEFAULT +7 _start
-+ +38: 0+10010658 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-+ +39: 0+50 +0 TLS +GLOBAL DEFAULT +11 ld2
-+ +40: 0+48 +0 TLS +GLOBAL DEFAULT +11 ld1
-+ +41: 0+10010628 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-+ +42: 0+10010628 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-+ +43: 0+10010658 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-+ +44: 0+38 +0 TLS +GLOBAL DEFAULT +11 gd0
-+ +45: 0+58 +0 TLS +GLOBAL DEFAULT +11 ie0
---- ld/testsuite/ld-powerpc/tlsexe.t 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexe.t 9 Feb 2003 03:10:53 -0000
-@@ -7,7 +7,7 @@
- .*: +file format elf64-powerpc
-
- Contents of section \.tdata:
-- 10010410 12345678 9abcdef0 23456789 abcdef01 .*
-- 10010420 3456789a bcdef012 456789ab cdef0123 .*
-- 10010430 56789abc def01234 6789abcd ef012345 .*
-- 10010440 789abcde f0123456 .*
-+ 10010470 12345678 9abcdef0 23456789 abcdef01 .*
-+ 10010480 3456789a bcdef012 456789ab cdef0123 .*
-+ 10010490 56789abc def01234 6789abcd ef012345 .*
-+ 100104a0 789abcde f0123456 .*
---- ld/testsuite/ld-powerpc/tlsexetoc.d 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexetoc.d 9 Feb 2003 03:10:53 -0000
-@@ -8,26 +8,45 @@
-
- Disassembly of section \.text:
-
--0+10000338 <_start>:
-- 10000338: e8 62 80 08 ld r3,-32760\(r2\)
-- 1000033c: 60 00 00 00 nop
-- 10000340: 7c 63 6a 14 add r3,r3,r13
-- 10000344: e8 62 80 18 ld r3,-32744\(r2\)
-- 10000348: 60 00 00 00 nop
-- 1000034c: 7c 63 6a 14 add r3,r3,r13
-- 10000350: 3c 6d 00 00 addis r3,r13,0
-- 10000354: 60 00 00 00 nop
-- 10000358: 38 63 91 40 addi r3,r3,-28352
-- 1000035c: 3c 6d 00 00 addis r3,r13,0
-- 10000360: 60 00 00 00 nop
-- 10000364: 38 63 10 00 addi r3,r3,4096
-- 10000368: 39 23 80 40 addi r9,r3,-32704
-- 1000036c: 3d 23 00 00 addis r9,r3,0
-- 10000370: 81 49 80 48 lwz r10,-32696\(r9\)
-- 10000374: 3d 2d 00 00 addis r9,r13,0
-- 10000378: 7d 49 18 2a ldx r10,r9,r3
-- 1000037c: 3d 2d 00 00 addis r9,r13,0
-- 10000380: a1 49 91 88 lhz r10,-28280\(r9\)
-- 10000384: 89 4d 90 60 lbz r10,-28576\(r13\)
-- 10000388: 3d 2d 00 00 addis r9,r13,0
-- 1000038c: 99 49 90 68 stb r10,-28568\(r9\)
-+0+10000370 <_start-0x1c>:
-+ 10000370: 3d 82 00 00 addis r12,r2,0
-+ 10000374: f8 41 00 28 std r2,40\(r1\)
-+ 10000378: e9 6c 80 70 ld r11,-32656\(r12\)
-+ 1000037c: e8 4c 80 78 ld r2,-32648\(r12\)
-+ 10000380: 7d 69 03 a6 mtctr r11
-+ 10000384: e9 6c 80 80 ld r11,-32640\(r12\)
-+ 10000388: 4e 80 04 20 bctr
-+
-+0+1000038c <_start>:
-+ 1000038c: e8 62 80 08 ld r3,-32760\(r2\)
-+ 10000390: 60 00 00 00 nop
-+ 10000394: 7c 63 6a 14 add r3,r3,r13
-+ 10000398: 38 62 80 18 addi r3,r2,-32744
-+ 1000039c: 4b ff ff d5 bl 10000370 <le1\+0x10000308>
-+ 100003a0: e8 41 00 28 ld r2,40\(r1\)
-+ 100003a4: 3c 6d 00 00 addis r3,r13,0
-+ 100003a8: 60 00 00 00 nop
-+ 100003ac: 38 63 91 90 addi r3,r3,-28272
-+ 100003b0: 3c 6d 00 00 addis r3,r13,0
-+ 100003b4: 60 00 00 00 nop
-+ 100003b8: 38 63 10 00 addi r3,r3,4096
-+ 100003bc: 39 23 80 40 addi r9,r3,-32704
-+ 100003c0: 3d 23 00 00 addis r9,r3,0
-+ 100003c4: 81 49 80 48 lwz r10,-32696\(r9\)
-+ 100003c8: 3d 2d 00 00 addis r9,r13,0
-+ 100003cc: 7d 49 18 2a ldx r10,r9,r3
-+ 100003d0: 3d 2d 00 00 addis r9,r13,0
-+ 100003d4: a1 49 91 d8 lhz r10,-28200\(r9\)
-+ 100003d8: 89 4d 90 60 lbz r10,-28576\(r13\)
-+ 100003dc: 3d 2d 00 00 addis r9,r13,0
-+ 100003e0: 99 49 90 68 stb r10,-28568\(r9\)
-+ 100003e4: e8 41 00 28 ld r2,40\(r1\)
-+ 100003e8: 3d 82 00 00 addis r12,r2,0
-+ 100003ec: e9 6c 80 58 ld r11,-32680\(r12\)
-+ 100003f0: e8 4c 80 60 ld r2,-32672\(r12\)
-+ 100003f4: 7d 69 03 a6 mtctr r11
-+ 100003f8: e9 6c 80 68 ld r11,-32664\(r12\)
-+ 100003fc: 4e 80 04 20 bctr
-+ 10000400: 60 00 00 00 nop
-+ 10000404: 38 00 00 00 li r0,0
-+ 10000408: 4b ff ff dc b 100003e4 <_start\+0x58>
---- ld/testsuite/ld-powerpc/tlsexetoc.g 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexetoc.g 9 Feb 2003 03:10:53 -0000
-@@ -7,8 +7,8 @@
- .*: +file format elf64-powerpc
-
- Contents of section \.toc:
-- 100104d0 00000000 00000000 00000000 00000000 .*
-- 100104e0 00000000 00000000 00000000 00000000 .*
-- 100104f0 00000000 00000001 00000000 00000000 .*
-- 10010500 00000000 00000001 00000000 00000000 .*
-- 10010510 ffffffff ffff8050 00000000 00000000 .*
-+ 100105a0 00000000 00000000 00000000 00000000 .*
-+ 100105b0 00000000 00000000 00000000 00000000 .*
-+ 100105c0 00000000 00000001 00000000 00000000 .*
-+ 100105d0 00000000 00000001 00000000 00000000 .*
-+ 100105e0 ffffffff ffff8050 00000000 00000000 .*
---- ld/testsuite/ld-powerpc/tlsexetoc.r 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexetoc.r 9 Feb 2003 03:10:53 -0000
-@@ -1,39 +1,41 @@
- #source: tlslib.s
- #source: tlstoc.s
- #as: -a64
--#ld: -shared -melf64ppc
-+#ld: -melf64ppc
- #readelf: -WSsrl
- #target: powerpc64*-*-*
-
--There are 21 section headers.*
-+There are 23 section headers.*
-
- Section Headers:
- +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
- +\[ 0\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0
-- +\[ 1\] .interp +PROGBITS +0+10000190 0+190 0+11 0+ +A +0 +0 +1
-- +\[ 2\] .hash +HASH +0+100001a8 0+1a8 0+38 04 +A +3 +0 +8
-- +\[ 3\] .dynsym +DYNSYM +0+100001e0 0+1e0 0+d8 18 +A +4 +1 +8
-- +\[ 4\] .dynstr +STRTAB +0+100002b8 0+2b8 0+4d 0+ +A +0 +0 +1
-- +\[ 5\] .rela.dyn +RELA +0+10000308 0+308 0+30 18 +A +3 +0 +8
-- +\[ 6\] .text +PROGBITS +0+10000338 0+338 0+58 0+ +AX +0 +0 +4
-- +\[ 7\] .data +PROGBITS +0+10010390 0+390 0+ 0+ +WA +0 +0 +1
-- +\[ 8\] .branch_lt +PROGBITS +0+10010390 0+390 0+ 0+ +WA +0 +0 +8
-- +\[ 9\] .tdata +PROGBITS +0+10010390 0+390 0+38 0+ WAT +0 +0 +8
-- +\[10\] .tbss +NOBITS +0+100103c8 0+3c8 0+38 0+ WAT +0 +0 +8
-- +\[11\] .dynamic +DYNAMIC +0+100103c8 0+3c8 0+100 10 +WA +4 +0 +8
-- +\[12\] .ctors +PROGBITS +0+100104c8 0+520 0+ 0+ +W +0 +0 +1
-- +\[13\] .dtors +PROGBITS +0+100104c8 0+520 0+ 0+ +W +0 +0 +1
-- +\[14\] .got +PROGBITS +0+100104c8 0+4c8 0+8 08 +WA +0 +0 +8
-- +\[15\] .toc +PROGBITS +0+100104d0 0+4d0 0+50 0+ +WA +0 +0 +1
-- +\[16\] .sbss +PROGBITS +0+10010520 0+520 0+ 0+ +W +0 +0 +1
-- +\[17\] .bss +NOBITS +0+10010520 0+520 0+ 0+ +WA +0 +0 +1
-- +\[18\] .shstrtab +STRTAB +0+ 0+520 0+93 0+ +0 +0 +1
-- +\[19\] .symtab +SYMTAB +0+ 0+af8 0+438 18 +20 +1d +8
-- +\[20\] .strtab +STRTAB +0+ 0+f30 0+83 0+ +0 +0 +1
-+ +\[ 1\] \.interp +PROGBITS +0+10000190 0+190 0+11 0+ +A +0 +0 +1
-+ +\[ 2\] \.hash +HASH +0+100001a8 0+1a8 0+3c 04 +A +3 +0 +8
-+ +\[ 3\] \.dynsym +DYNSYM +0+100001e8 0+1e8 0+f0 18 +A +4 +1 +8
-+ +\[ 4\] \.dynstr +STRTAB +0+100002d8 0+2d8 0+4d 0+ +A +0 +0 +1
-+ +\[ 5\] \.rela\.dyn +RELA +0+10000328 0+328 0+30 18 +A +3 +0 +8
-+ +\[ 6\] \.rela\.plt +RELA +0+10000358 0+358 0+18 18 +A +3 +12 +8
-+ +\[ 7\] \.text +PROGBITS +0+10000370 0+370 0+9c 0+ +AX +0 +0 +4
-+ +\[ 8\] \.data +PROGBITS +0+10010410 0+410 0+ 0+ +WA +0 +0 +1
-+ +\[ 9\] \.branch_lt +PROGBITS +0+10010410 0+410 0+ 0+ +WA +0 +0 +8
-+ +\[10\] \.tdata +PROGBITS +0+10010410 0+410 0+38 0+ WAT +0 +0 +8
-+ +\[11\] \.tbss +NOBITS +0+10010448 0+448 0+38 0+ WAT +0 +0 +8
-+ +\[12\] \.dynamic +DYNAMIC +0+10010448 0+448 0+150 10 +WA +4 +0 +8
-+ +\[13\] \.ctors +PROGBITS +0+10010598 0+5f0 0+ 0+ +W +0 +0 +1
-+ +\[14\] \.dtors +PROGBITS +0+10010598 0+5f0 0+ 0+ +W +0 +0 +1
-+ +\[15\] \.got +PROGBITS +0+10010598 0+598 0+8 08 +WA +0 +0 +8
-+ +\[16\] \.toc +PROGBITS +0+100105a0 0+5a0 0+50 0+ +WA +0 +0 +1
-+ +\[17\] \.sbss +PROGBITS +0+100105f0 0+5f0 0+ 0+ +W +0 +0 +1
-+ +\[18\] \.plt +NOBITS +0+100105f0 0+5f0 0+30 18 +WA +0 +0 +8
-+ +\[19\] \.bss +NOBITS +0+10010620 0+5f0 0+ 0+ +WA +0 +0 +1
-+ +\[20\] \.shstrtab +STRTAB +0+ 0+5f0 0+9d 0+ +0 +0 +1
-+ +\[21\] \.symtab +SYMTAB +0+ 0+c50 0+480 18 +22 +1f +8
-+ +\[22\] \.strtab +STRTAB +0+ 0+10d0 0+92 0+ +0 +0 +1
- #...
-
- Elf file type is EXEC \(Executable file\)
--Entry point 0x10000338
-+Entry point 0x1000038c
- There are 6 program headers.*
-
- Program Headers:
-@@ -41,81 +43,89 @@ Program Headers:
- +PHDR +0x0+40 0x0+10000040 0x0+10000040 0x0+150 0x0+150 R E 0x8
- +INTERP +0x0+190 0x0+10000190 0x0+10000190 0x0+11 0x0+11 R +0x1
- +\[Requesting program interpreter: .*\]
-- +LOAD +0x0+ 0x0+10000000 0x0+10000000 0x0+390 0x0+390 R E 0x10000
-- +LOAD +0x0+390 0x0+10010390 0x0+10010390 0x0+190 0x0+190 RW +0x10000
-- +DYNAMIC +0x0+3c8 0x0+100103c8 0x0+100103c8 0x0+100 0x0+100 RW +0x8
-- +TLS +0x0+390 0x0+10010390 0x0+10010390 0x0+38 0x0+70 R +0x8
-+ +LOAD +0x0+ 0x0+10000000 0x0+10000000 0x0+40c 0x0+40c R E 0x10000
-+ +LOAD +0x0+410 0x0+10010410 0x0+10010410 0x0+1e0 0x0+210 RW +0x10000
-+ +DYNAMIC +0x0+448 0x0+10010448 0x0+10010448 0x0+150 0x0+150 RW +0x8
-+ +TLS +0x0+410 0x0+10010410 0x0+10010410 0x0+38 0x0+70 R +0x8
-
- Section to Segment mapping:
- +Segment Sections\.\.\.
-- +00 +
-+ +0+ +
- +01 +\.interp
-- +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.text
-- +03 +\.tdata \.tbss \.dynamic \.got \.toc
-+ +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text
-+ +03 +\.tdata \.tbss \.dynamic \.got \.toc \.plt
- +04 +\.tbss \.dynamic
- +05 +\.tdata \.tbss
-
- Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
- +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
--0+100104d0 +0+200000049 R_PPC64_TPREL64 +0+ gd \+ 0
--0+100104e0 +0+400000049 R_PPC64_TPREL64 +0+ ld \+ 0
-+0+100105a0 +0+200000049 R_PPC64_TPREL64 +0+ gd \+ 0
-+0+100105b0 +0+500000044 R_PPC64_DTPMOD64 +0+ ld \+ 0
-
--Symbol table '\.dynsym' contains 9 entries:
-+Relocation section '\.rela\.plt' at offset .* contains 1 entries:
-+ +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-+0+10010608 +0+300000015 R_PPC64_JMP_SLOT +0+ __tls_get_addr \+ 0
-+
-+Symbol table '\.dynsym' contains 10 entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND
-- +1: 0+100103c8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-+ +1: 0+10010448 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +2: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-- +3: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND \.__tls_get_addr
-- +4: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-- +5: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-- +6: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-- +7: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-- +8: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-+ +3: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
-+ +4: 0+ +0 FUNC +GLOBAL DEFAULT +UND \.__tls_get_addr
-+ +5: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-+ +6: 0+10010620 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-+ +7: 0+100105f0 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-+ +8: 0+100105f0 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-+ +9: 0+10010620 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-
--Symbol table '\.symtab' contains 45 entries:
-+Symbol table '\.symtab' contains 48 entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND
- +1: 0+10000190 +0 SECTION LOCAL +DEFAULT +1
- +2: 0+100001a8 +0 SECTION LOCAL +DEFAULT +2
-- +3: 0+100001e0 +0 SECTION LOCAL +DEFAULT +3
-- +4: 0+100002b8 +0 SECTION LOCAL +DEFAULT +4
-- +5: 0+10000308 +0 SECTION LOCAL +DEFAULT +5
-- +6: 0+10000338 +0 SECTION LOCAL +DEFAULT +6
-- +7: 0+10010390 +0 SECTION LOCAL +DEFAULT +7
-- +8: 0+10010390 +0 SECTION LOCAL +DEFAULT +8
-- +9: 0+10010390 +0 SECTION LOCAL +DEFAULT +9
-- +10: 0+100103c8 +0 SECTION LOCAL +DEFAULT +10
-- +11: 0+100103c8 +0 SECTION LOCAL +DEFAULT +11
-- +12: 0+100104c8 +0 SECTION LOCAL +DEFAULT +12
-- +13: 0+100104c8 +0 SECTION LOCAL +DEFAULT +13
-- +14: 0+100104c8 +0 SECTION LOCAL +DEFAULT +14
-- +15: 0+100104d0 +0 SECTION LOCAL +DEFAULT +15
-- +16: 0+10010520 +0 SECTION LOCAL +DEFAULT +16
-- +17: 0+10010520 +0 SECTION LOCAL +DEFAULT +17
-- +18: 0+ +0 SECTION LOCAL +DEFAULT +18
-- +19: 0+ +0 SECTION LOCAL +DEFAULT +19
-+ +3: 0+100001e8 +0 SECTION LOCAL +DEFAULT +3
-+ +4: 0+100002d8 +0 SECTION LOCAL +DEFAULT +4
-+ +5: 0+10000328 +0 SECTION LOCAL +DEFAULT +5
-+ +6: 0+10000358 +0 SECTION LOCAL +DEFAULT +6
-+ +7: 0+10000370 +0 SECTION LOCAL +DEFAULT +7
-+ +8: 0+10010410 +0 SECTION LOCAL +DEFAULT +8
-+ +9: 0+10010410 +0 SECTION LOCAL +DEFAULT +9
-+ +10: 0+10010410 +0 SECTION LOCAL +DEFAULT +10
-+ +11: 0+10010448 +0 SECTION LOCAL +DEFAULT +11
-+ +12: 0+10010448 +0 SECTION LOCAL +DEFAULT +12
-+ +13: 0+10010598 +0 SECTION LOCAL +DEFAULT +13
-+ +14: 0+10010598 +0 SECTION LOCAL +DEFAULT +14
-+ +15: 0+10010598 +0 SECTION LOCAL +DEFAULT +15
-+ +16: 0+100105a0 +0 SECTION LOCAL +DEFAULT +16
-+ +17: 0+100105f0 +0 SECTION LOCAL +DEFAULT +17
-+ +18: 0+100105f0 +0 SECTION LOCAL +DEFAULT +18
-+ +19: 0+10010620 +0 SECTION LOCAL +DEFAULT +19
- +20: 0+ +0 SECTION LOCAL +DEFAULT +20
-- +21: 0+ +0 TLS +LOCAL +DEFAULT +9 gd4
-- +22: 0+8 +0 TLS +LOCAL +DEFAULT +9 ld4
-- +23: 0+10 +0 TLS +LOCAL +DEFAULT +9 ld5
-- +24: 0+18 +0 TLS +LOCAL +DEFAULT +9 ld6
-- +25: 0+20 +0 TLS +LOCAL +DEFAULT +9 ie4
-- +26: 0+28 +0 TLS +LOCAL +DEFAULT +9 le4
-- +27: 0+30 +0 TLS +LOCAL +DEFAULT +9 le5
-- +28: 0+10010518 +0 NOTYPE +LOCAL +DEFAULT +15 \.Lie0
-- +29: 0+100103c8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-- +30: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-- +31: 0+60 +0 TLS +GLOBAL DEFAULT +10 le0
-- +32: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND \.__tls_get_addr
-- +33: 0+40 +0 TLS +GLOBAL DEFAULT +10 ld0
-- +34: 0+68 +0 TLS +GLOBAL DEFAULT +10 le1
-- +35: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-- +36: 0+10000338 +0 NOTYPE +GLOBAL DEFAULT +6 _start
-- +37: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-- +38: 0+50 +0 TLS +GLOBAL DEFAULT +10 ld2
-- +39: 0+48 +0 TLS +GLOBAL DEFAULT +10 ld1
-- +40: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-- +41: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-- +42: 0+10010520 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-- +43: 0+38 +0 TLS +GLOBAL DEFAULT +10 gd0
-- +44: 0+58 +0 TLS +GLOBAL DEFAULT +10 ie0
-+ +21: 0+ +0 SECTION LOCAL +DEFAULT +21
-+ +22: 0+ +0 SECTION LOCAL +DEFAULT +22
-+ +23: 0+ +0 TLS +LOCAL +DEFAULT +10 gd4
-+ +24: 0+8 +0 TLS +LOCAL +DEFAULT +10 ld4
-+ +25: 0+10 +0 TLS +LOCAL +DEFAULT +10 ld5
-+ +26: 0+18 +0 TLS +LOCAL +DEFAULT +10 ld6
-+ +27: 0+20 +0 TLS +LOCAL +DEFAULT +10 ie4
-+ +28: 0+28 +0 TLS +LOCAL +DEFAULT +10 le4
-+ +29: 0+30 +0 TLS +LOCAL +DEFAULT +10 le5
-+ +30: 0+100105e8 +0 NOTYPE +LOCAL +DEFAULT +16 \.Lie0
-+ +31: 0+10010448 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
-+ +32: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
-+ +33: 0+60 +0 TLS +GLOBAL DEFAULT +11 le0
-+ +34: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
-+ +35: 0+ +0 FUNC +GLOBAL DEFAULT +UND \.__tls_get_addr
-+ +36: 0+40 +0 TLS +GLOBAL DEFAULT +11 ld0
-+ +37: 0+68 +0 TLS +GLOBAL DEFAULT +11 le1
-+ +38: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
-+ +39: 0+1000038c +0 NOTYPE +GLOBAL DEFAULT +7 _start
-+ +40: 0+10010620 +0 NOTYPE +GLOBAL DEFAULT +ABS __end
-+ +41: 0+50 +0 TLS +GLOBAL DEFAULT +11 ld2
-+ +42: 0+48 +0 TLS +GLOBAL DEFAULT +11 ld1
-+ +43: 0+100105f0 +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
-+ +44: 0+100105f0 +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-+ +45: 0+10010620 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
-+ +46: 0+38 +0 TLS +GLOBAL DEFAULT +11 gd0
-+ +47: 0+58 +0 TLS +GLOBAL DEFAULT +11 ie0
---- ld/testsuite/ld-powerpc/tlsexetoc.t 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlsexetoc.t 9 Feb 2003 03:10:53 -0000
-@@ -7,7 +7,7 @@
- .*: +file format elf64-powerpc
-
- Contents of section \.tdata:
-- 10010390 12345678 9abcdef0 23456789 abcdef01 .*
-- 100103a0 3456789a bcdef012 456789ab cdef0123 .*
-- 100103b0 56789abc def01234 6789abcd ef012345 .*
-- 100103c0 789abcde f0123456 .*
-+ 10010410 12345678 9abcdef0 23456789 abcdef01 .*
-+ 10010420 3456789a bcdef012 456789ab cdef0123 .*
-+ 10010430 56789abc def01234 6789abcd ef012345 .*
-+ 10010440 789abcde f0123456 .*
---- ld/testsuite/ld-powerpc/tlslib.s 4 Feb 2003 14:52:11 -0000 1.1
-+++ ld/testsuite/ld-powerpc/tlslib.s 9 Feb 2003 03:10:53 -0000
-@@ -1,4 +1,5 @@
- .global .__tls_get_addr,__tls_get_addr,gd,ld
-+ .type .__tls_get_addr,@function
-
- .section ".opd","aw",@progbits
- __tls_get_addr:
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls2.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls2.patch
deleted file mode 100644
index b5cb6d2cbbfa..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-ppc64-tls2.patch
+++ /dev/null
@@ -1,421 +0,0 @@
-2003-02-10 Alan Modra <amodra@bigpond.net.au>
-
- * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
- variables, structure fields or function params to tls_mask or
- similar to better reflect usage.
- (struct got_entry): Comment.
- (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
- (get_tls_mask): Rename from get_tls_type.
-
---- bfd/elf64-ppc.c 9 Feb 2003 04:36:23 -0000 1.82
-+++ bfd/elf64-ppc.c 9 Feb 2003 13:41:25 -0000
-@@ -2503,14 +2503,18 @@ struct got_entry
- {
- struct got_entry *next;
-
-+ /* The symbol addend that we'll be placing in the GOT. */
- bfd_vma addend;
-
-+ /* Reference count until size_dynamic_sections, GOT offset thereafter. */
- union
- {
- bfd_signed_vma refcount;
- bfd_vma offset;
- } got;
-
-+ /* Zero for non-tls entries, or TLS_TLS and one of TLS_GD, TLS_LD,
-+ TLS_TPREL or TLS_DTPREL for tls entries. */
- char tls_type;
- };
-
-@@ -2633,15 +2637,21 @@ struct ppc_link_hash_entry
- unsigned int is_entry:1;
-
- /* Contexts in which symbol is used in the GOT (or TOC).
-- Linker optimization will result in various transformations. */
--#define TLS_TLS 1 /* Any TLS reloc. */
--#define TLS_GD 2 /* GD reloc. */
--#define TLS_LD 4 /* LD reloc. */
--#define TLS_TPREL 8 /* TPREL reloc, => IE. */
--#define TLS_DTPREL 16 /* DTPREL reloc, => LD. */
--#define TLS_EXPLICIT 32 /* Marks TOC section relocs. */
--#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */
-- char tls_type;
-+ TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the
-+ corresponding relocs are encountered during check_relocs.
-+ tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
-+ indicate the corresponding GOT entry type is not needed.
-+ tls_optimize may also set TLS_TPRELGD when a GD reloc turns into
-+ a TPREL one. We use a separate flag rather than setting TPREL
-+ just for convenience in distinguishing the two cases. */
-+#define TLS_GD 1 /* GD reloc. */
-+#define TLS_LD 2 /* LD reloc. */
-+#define TLS_TPREL 4 /* TPREL reloc, => IE. */
-+#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */
-+#define TLS_TLS 16 /* Any TLS reloc. */
-+#define TLS_EXPLICIT 32 /* Marks TOC section TLS relocs. */
-+#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */
-+ char tls_mask;
- };
-
- /* ppc64 ELF linker hash table. */
-@@ -2768,7 +2778,7 @@ static void ppc64_elf_hide_symbol
- static bfd_boolean get_sym_h
- PARAMS ((struct elf_link_hash_entry **, Elf_Internal_Sym **, asection **,
- char **, Elf_Internal_Sym **, unsigned long, bfd *));
--static int get_tls_type
-+static int get_tls_mask
- PARAMS ((char **, Elf_Internal_Sym **, const Elf_Internal_Rela *, bfd *));
- static bfd_boolean allocate_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-@@ -2910,7 +2920,7 @@ link_hash_newfunc (entry, table, string)
- eh->is_func = 0;
- eh->is_func_descriptor = 0;
- eh->is_entry = 0;
-- eh->tls_type = 0;
-+ eh->tls_mask = 0;
- }
-
- return entry;
-@@ -3411,13 +3421,13 @@ update_local_sym_info (abfd, symtab_hdr,
- int tls_type;
- {
- struct got_entry **local_got_ents = elf_local_got_ents (abfd);
-- char *local_got_tls_types;
-+ char *local_got_tls_masks;
-
- if (local_got_ents == NULL)
- {
- bfd_size_type size = symtab_hdr->sh_info;
-
-- size *= sizeof (*local_got_ents) + sizeof (char);
-+ size *= sizeof (*local_got_ents) + sizeof (*local_got_tls_masks);
- local_got_ents = (struct got_entry **) bfd_zalloc (abfd, size);
- if (local_got_ents == NULL)
- return FALSE;
-@@ -3446,8 +3456,8 @@ update_local_sym_info (abfd, symtab_hdr,
- ent->got.refcount += 1;
- }
-
-- local_got_tls_types = (char *) (local_got_ents + symtab_hdr->sh_info);
-- local_got_tls_types[r_symndx] |= tls_type;
-+ local_got_tls_masks = (char *) (local_got_ents + symtab_hdr->sh_info);
-+ local_got_tls_masks[r_symndx] |= tls_type;
- return TRUE;
- }
-
-@@ -3625,7 +3635,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
- eh->elf.got.glist = ent;
- }
- ent->got.refcount += 1;
-- eh->tls_type |= tls_type;
-+ eh->tls_mask |= tls_type;
- }
- else
- /* This is a global offset table entry for a local symbol. */
-@@ -3754,7 +3764,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
- {
- struct ppc_link_hash_entry *eh;
- eh = (struct ppc_link_hash_entry *) h;
-- eh->tls_type |= tls_type;
-+ eh->tls_mask |= tls_type;
- }
- else
- if (!update_local_sym_info (abfd, symtab_hdr, r_symndx,
-@@ -3763,7 +3773,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
-
- if (ppc64_elf_section_data (sec)->t_symndx == NULL)
- {
-- /* One extra to simplify get_tls_type. */
-+ /* One extra to simplify get_tls_mask. */
- bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1;
- ppc64_elf_section_data (sec)->t_symndx
- = (unsigned *) bfd_zalloc (abfd, amt);
-@@ -4687,11 +4697,11 @@ ppc64_elf_hide_symbol (info, h, force_lo
- }
-
- static bfd_boolean
--get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd)
-+get_sym_h (hp, symp, symsecp, tls_maskp, locsymsp, r_symndx, ibfd)
- struct elf_link_hash_entry **hp;
- Elf_Internal_Sym **symp;
- asection **symsecp;
-- char **tlstypep;
-+ char **tls_maskp;
- Elf_Internal_Sym **locsymsp;
- unsigned long r_symndx;
- bfd *ibfd;
-@@ -4723,12 +4733,12 @@ get_sym_h (hp, symp, symsecp, tlstypep,
- *symsecp = symsec;
- }
-
-- if (tlstypep != NULL)
-+ if (tls_maskp != NULL)
- {
- struct ppc_link_hash_entry *eh;
-
- eh = (struct ppc_link_hash_entry *) h;
-- *tlstypep = &eh->tls_type;
-+ *tls_maskp = &eh->tls_mask;
- }
- }
- else
-@@ -4765,31 +4775,31 @@ get_sym_h (hp, symp, symsecp, tlstypep,
- *symsecp = symsec;
- }
-
-- if (tlstypep != NULL)
-+ if (tls_maskp != NULL)
- {
- struct got_entry **lgot_ents;
-- char *tlstype;
-+ char *tls_mask;
-
-- tlstype = NULL;
-+ tls_mask = NULL;
- lgot_ents = elf_local_got_ents (ibfd);
- if (lgot_ents != NULL)
- {
-- char *lgot_types = (char *) (lgot_ents + symtab_hdr->sh_info);
-- tlstype = &lgot_types[r_symndx];
-+ char *lgot_masks = (char *) (lgot_ents + symtab_hdr->sh_info);
-+ tls_mask = &lgot_masks[r_symndx];
- }
-- *tlstypep = tlstype;
-+ *tls_maskp = tls_mask;
- }
- }
- return TRUE;
- }
-
--/* Returns TLS_TYPE for the given REL symbol. Function return is 0 on
-+/* Returns TLS_MASKP for the given REL symbol. Function return is 0 on
- error, 2 on a toc GD type suitable for optimization, 3 on a toc LD
- type suitable for optimization, and 1 otherwise. */
-
- static int
--get_tls_type (tls_type, locsymsp, rel, ibfd)
-- char **tls_type;
-+get_tls_mask (tls_maskp, locsymsp, rel, ibfd)
-+ char **tls_maskp;
- Elf_Internal_Sym **locsymsp;
- const Elf_Internal_Rela *rel;
- bfd *ibfd;
-@@ -4802,10 +4812,10 @@ get_tls_type (tls_type, locsymsp, rel, i
- bfd_vma off;
-
- r_symndx = ELF64_R_SYM (rel->r_info);
-- if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd))
-+ if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd))
- return 0;
-
-- if ((*tls_type != NULL && **tls_type != 0)
-+ if ((*tls_maskp != NULL && **tls_maskp != 0)
- || sec == NULL
- || ppc64_elf_section_data (sec)->t_symndx == NULL)
- return 1;
-@@ -4822,7 +4832,7 @@ get_tls_type (tls_type, locsymsp, rel, i
- BFD_ASSERT (off % 8 == 0);
- r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8];
- next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1];
-- if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd))
-+ if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd))
- return 0;
- if (h == NULL
- || h->root.type == bfd_link_hash_defined
-@@ -5210,13 +5220,13 @@ ppc64_elf_tls_optimize (obfd, info)
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sym_sec;
-- char *tls_type;
-- char tls_set, tls_clear, got_tls_type = 0;
-+ char *tls_mask;
-+ char tls_set, tls_clear, tls_type = 0;
- bfd_vma value;
- bfd_boolean ok_tprel, is_local;
-
- r_symndx = ELF64_R_SYM (rel->r_info);
-- if (!get_sym_h (&h, &sym, &sym_sec, &tls_type, &locsyms,
-+ if (!get_sym_h (&h, &sym, &sym_sec, &tls_mask, &locsyms,
- r_symndx, ibfd))
- {
- err_free_rel:
-@@ -5270,7 +5280,7 @@ ppc64_elf_tls_optimize (obfd, info)
- /* LD -> LE */
- tls_set = 0;
- tls_clear = TLS_LD;
-- got_tls_type = TLS_TLS | TLS_LD;
-+ tls_type = TLS_TLS | TLS_LD;
- expecting_tls_get_addr = 1;
- break;
-
-@@ -5285,7 +5295,7 @@ ppc64_elf_tls_optimize (obfd, info)
- /* GD -> IE */
- tls_set = TLS_TLS | TLS_TPRELGD;
- tls_clear = TLS_GD;
-- got_tls_type = TLS_TLS | TLS_GD;
-+ tls_type = TLS_TLS | TLS_GD;
- expecting_tls_get_addr = 1;
- break;
-
-@@ -5299,7 +5309,7 @@ ppc64_elf_tls_optimize (obfd, info)
- /* IE -> LE */
- tls_set = 0;
- tls_clear = TLS_TPREL;
-- got_tls_type = TLS_TLS | TLS_TPREL;
-+ tls_type = TLS_TLS | TLS_TPREL;
- break;
- }
- else
-@@ -5323,7 +5333,7 @@ ppc64_elf_tls_optimize (obfd, info)
- char *toc_tls;
- int retval;
-
-- retval = get_tls_type (&toc_tls, &locsyms,
-+ retval = get_tls_mask (&toc_tls, &locsyms,
- rel - 1, ibfd);
- if (retval == 0)
- goto err_free_rel;
-@@ -5401,7 +5411,7 @@ ppc64_elf_tls_optimize (obfd, info)
-
- for (; ent != NULL; ent = ent->next)
- if (ent->addend == rel->r_addend
-- && ent->tls_type == got_tls_type)
-+ && ent->tls_type == tls_type)
- break;
- if (ent == NULL)
- abort ();
-@@ -5438,8 +5448,8 @@ ppc64_elf_tls_optimize (obfd, info)
- }
- }
-
-- *tls_type |= tls_set;
-- *tls_type &= ~tls_clear;
-+ *tls_mask |= tls_set;
-+ *tls_mask &= ~tls_clear;
- }
-
- if (elf_section_data (sec)->relocs != relstart)
-@@ -5547,7 +5557,7 @@ allocate_dynrelocs (h, inf)
- eh = (struct ppc_link_hash_entry *) h;
- /* Run through the TLS GD got entries first if we're changing them
- to TPREL. */
-- if ((eh->tls_type & TLS_TPRELGD) != 0)
-+ if ((eh->tls_mask & TLS_TPRELGD) != 0)
- for (gent = h->got.glist; gent != NULL; gent = gent->next)
- if (gent->got.refcount > 0
- && (gent->tls_type & TLS_GD) != 0)
-@@ -5592,11 +5602,11 @@ allocate_dynrelocs (h, inf)
-
- s = htab->sgot;
- gent->got.offset = s->_raw_size;
-- s->_raw_size += (gent->tls_type & eh->tls_type & TLS_GD) ? 16 : 8;
-+ s->_raw_size += (gent->tls_type & eh->tls_mask & TLS_GD) ? 16 : 8;
- dyn = htab->elf.dynamic_sections_created;
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
- htab->srelgot->_raw_size
-- += (gent->tls_type & eh->tls_type & TLS_GD
-+ += (gent->tls_type & eh->tls_mask & TLS_GD
- ? 2 * sizeof (Elf64_External_Rela)
- : sizeof (Elf64_External_Rela));
- }
-@@ -5752,7 +5762,7 @@ ppc64_elf_size_dynamic_sections (output_
- {
- struct got_entry **lgot_ents;
- struct got_entry **end_lgot_ents;
-- char *lgot_types;
-+ char *lgot_masks;
- bfd_size_type locsymcount;
- Elf_Internal_Shdr *symtab_hdr;
- asection *srel;
-@@ -5794,17 +5804,17 @@ ppc64_elf_size_dynamic_sections (output_
- symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
- locsymcount = symtab_hdr->sh_info;
- end_lgot_ents = lgot_ents + locsymcount;
-- lgot_types = (char *) end_lgot_ents;
-+ lgot_masks = (char *) end_lgot_ents;
- s = htab->sgot;
- srel = htab->srelgot;
-- for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_types)
-+ for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_masks)
- {
- struct got_entry *ent;
-
- for (ent = *lgot_ents; ent != NULL; ent = ent->next)
- if (ent->got.refcount > 0)
- {
-- if ((ent->tls_type & *lgot_types & TLS_LD) != 0)
-+ if ((ent->tls_type & *lgot_masks & TLS_LD) != 0)
- {
- if (htab->tlsld_got.offset == (bfd_vma) -1)
- {
-@@ -5818,7 +5828,7 @@ ppc64_elf_size_dynamic_sections (output_
- else
- {
- ent->got.offset = s->_raw_size;
-- if ((ent->tls_type & *lgot_types & TLS_GD) != 0)
-+ if ((ent->tls_type & *lgot_masks & TLS_GD) != 0)
- {
- s->_raw_size += 16;
- if (info->shared)
-@@ -6660,12 +6670,12 @@ ppc64_elf_size_stubs (output_bfd, stub_b
- && irela != internal_relocs)
- {
- /* Get tls info. */
-- char *tls_type;
-+ char *tls_mask;
-
-- if (!get_tls_type (&tls_type, &local_syms,
-+ if (!get_tls_mask (&tls_mask, &local_syms,
- irela - 1, input_bfd))
- goto error_ret_free_internal;
-- if (*tls_type != 0)
-+ if (*tls_mask != 0)
- continue;
- }
-
-@@ -7098,12 +7108,12 @@ ppc64_elf_relocate_section (output_bfd,
- if (IS_TLS_RELOC (r_type))
- {
- if (h != NULL)
-- tls_mask = ((struct ppc_link_hash_entry *) h)->tls_type;
-+ tls_mask = ((struct ppc_link_hash_entry *) h)->tls_mask;
- else if (local_got_ents != NULL)
- {
-- char *lgot_types;
-- lgot_types = (char *) (local_got_ents + symtab_hdr->sh_info);
-- tls_mask = lgot_types[r_symndx];
-+ char *lgot_masks;
-+ lgot_masks = (char *) (local_got_ents + symtab_hdr->sh_info);
-+ tls_mask = lgot_masks[r_symndx];
- }
- }
-
-@@ -7133,7 +7143,7 @@ ppc64_elf_relocate_section (output_bfd,
- char *toc_tls;
- int retval;
-
-- retval = get_tls_type (&toc_tls, &local_syms, rel, input_bfd);
-+ retval = get_tls_mask (&toc_tls, &local_syms, rel, input_bfd);
- if (retval == 0)
- return FALSE;
-
-@@ -7185,7 +7195,7 @@ ppc64_elf_relocate_section (output_bfd,
- /* Check for toc tls entries. */
- char *toc_tls;
-
-- if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd))
-+ if (!get_tls_mask (&toc_tls, &local_syms, rel, input_bfd))
- return FALSE;
-
- if (toc_tls)
-@@ -7671,7 +7681,7 @@ ppc64_elf_relocate_section (output_bfd,
- {
-
- relocation += ent->addend;
-- if ((tls_type & TLS_TLS) != 0)
-+ if (tls_type != 0)
- {
- relocation -= htab->tls_sec->vma + DTP_OFFSET;
- if ((tls_type & TLS_TPREL) != 0)
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-s390-noreladyn.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-s390-noreladyn.patch
deleted file mode 100644
index 6418536a6197..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-s390-noreladyn.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-2003-02-07 Jakub Jelinek <jakub@redhat.com>
-
- * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
- even if there is just non-empty .rela.plt.
-
---- bfd/elf32-s390.c.jj 2003-01-24 18:15:38.000000000 -0500
-+++ bfd/elf32-s390.c 2003-02-07 16:48:18.000000000 -0500
-@@ -1,5 +1,5 @@
- /* IBM S/390-specific support for 32-bit ELF
-- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
-+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
- Contributed by Carl B. Pedersen and Martin Schwidefsky.
-
- This file is part of BFD, the Binary File Descriptor library.
-@@ -2014,7 +2014,7 @@ elf_s390_size_dynamic_sections (output_b
- }
- else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
- {
-- if (s->_raw_size != 0 && s != htab->srelplt)
-+ if (s->_raw_size != 0)
- relocs = TRUE;
-
- /* We use the reloc_count field as a counter if we need
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-searchdir.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-searchdir.patch
deleted file mode 100644
index 3d2da52ae4fc..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-searchdir.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-2003-02-06 Jakub Jelinek <jakub@redhat.com>
-
- * genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths
- which already have it. Avoid duplicates.
-
---- ld/genscripts.sh.jj 2003-01-08 10:02:41.000000000 -0500
-+++ ld/genscripts.sh 2003-02-06 12:16:35.000000000 -0500
-@@ -77,20 +77,37 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE
- if [ x"$use_sysroot" != xyes ] ; then
- LIB_PATH=${libdir}
- fi
-+ LIB_PATH2=""
- for lib in ${NATIVE_LIB_DIRS}; do
- # The "=" is harmless if we aren't using a sysroot, but also needless.
- if [ "x${use_sysroot}" = "xyes" ] ; then
- lib="=${lib}"
- fi
-- case :${LIB_PATH}: in
-- *:${lib}:*) ;;
-- ::) LIB_PATH=${lib} ;;
-- *) LIB_PATH=${LIB_PATH}:${lib} ;;
-+ addsuffix=
-+ case "${LIBPATH_SUFFIX}:${lib}" in
-+ :*) ;;
-+ *:*${LIBPATH_SUFFIX}) ;;
-+ *) addsuffix=yes ;;
- esac
-+ if test -n "$addsuffix"; then
-+ case :${LIB_PATH}: in
-+ *:${lib}${LIBPATH_SUFFIX}:*) ;;
-+ ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
-+ *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
-+ esac
-+ case :${LIB_PATH}${LIB_PATH2}: in
-+ *:${lib}:*) ;;
-+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
-+ esac
-+ else
-+ case :${LIB_PATH}: in
-+ *:${lib}:*) ;;
-+ ::) LIB_PATH=${lib} ;;
-+ *) LIB_PATH=${LIB_PATH}:${lib} ;;
-+ esac
-+ fi
- done
-- if test -n "$LIBPATH_SUFFIX" ; then
-- LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,${LIBPATH_SUFFIX}:,g`$LIB_PATH
-- fi
-+ LIB_PATH=${LIB_PATH}${LIB_PATH2}
- fi
-
-
-
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sparc-nonpic.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sparc-nonpic.patch
deleted file mode 100644
index 663e0df76906..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sparc-nonpic.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-2002-04-20 Jakub Jelinek <jakub@redhat.com>
-
- * elf32-sparc.c (elf32_sparc_relocate_section): Find real output
- section with SEC_MERGE.
- * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
-
---- bfd/elf32-sparc.c.jj Thu Feb 6 08:07:10 2003
-+++ bfd/elf32-sparc.c Thu Feb 6 08:31:54 2003
-@@ -2168,7 +2168,7 @@ elf32_sparc_relocate_section (output_bfd
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sec;
-- bfd_vma relocation, off;
-+ bfd_vma relocation, off, orig_addend = 0;
- bfd_reloc_status_type r;
- bfd_boolean is_plt = FALSE;
- bfd_boolean unresolved_reloc;
-@@ -2196,6 +2196,7 @@ elf32_sparc_relocate_section (output_bfd
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
-+ orig_addend = rel->r_addend;
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
- }
- else
-@@ -2525,6 +2526,25 @@ elf32_sparc_relocate_section (output_bfd
- asection *osec;
-
- osec = sec->output_section;
-+ /* FIXME: As soon as making sections zero size
-+ is possible, this if can go away. */
-+ if (bfd_is_abs_section (osec)
-+ && h == NULL
-+ && (sec->flags & SEC_MERGE)
-+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-+ && (elf_section_data (sec)->sec_info_type
-+ == ELF_INFO_TYPE_MERGE))
-+ {
-+ asection *msec;
-+
-+ msec = sec;
-+ _bfd_merged_section_offset (output_bfd, &msec,
-+ elf_section_data (sec)->sec_info,
-+ sym->st_value + orig_addend,
-+ (bfd_vma) 0);
-+ osec = msec->output_section;
-+ }
-+
- indx = elf_section_data (osec)->dynindx;
-
- /* FIXME: we really should be able to link non-pic
---- bfd/elf64-sparc.c.jj Thu Feb 6 08:07:10 2003
-+++ bfd/elf64-sparc.c Thu Feb 6 08:31:54 2003
-@@ -2016,7 +2016,7 @@ sparc64_elf_relocate_section (output_bfd
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
- asection *sec;
-- bfd_vma relocation, off;
-+ bfd_vma relocation, off, orig_addend = 0;
- bfd_reloc_status_type r;
- bfd_boolean is_plt = FALSE;
- bfd_boolean unresolved_reloc;
-@@ -2039,6 +2039,7 @@ sparc64_elf_relocate_section (output_bfd
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
-+ orig_addend = rel->r_addend;
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
- }
- else
-@@ -2267,6 +2268,25 @@ sparc64_elf_relocate_section (output_bfd
- asection *osec;
-
- osec = sec->output_section;
-+ /* FIXME: As soon as making sections zero size
-+ is possible, this if can go away. */
-+ if (bfd_is_abs_section (osec)
-+ && h == NULL
-+ && (sec->flags & SEC_MERGE)
-+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-+ && (elf_section_data (sec)->sec_info_type
-+ == ELF_INFO_TYPE_MERGE))
-+ {
-+ asection *msec;
-+
-+ msec = sec;
-+ _bfd_merged_section_offset (output_bfd, &msec,
-+ elf_section_data (sec)->sec_info,
-+ sym->st_value + orig_addend,
-+ (bfd_vma) 0);
-+ osec = msec->output_section;
-+ }
-+
- indx = elf_section_data (osec)->dynindx;
-
- /* We are turning this relocation into one
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sub-same.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sub-same.patch
deleted file mode 100644
index b07f6e3e6738..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.18-sub-same.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-2003-02-13 Alan Modra <amodra@bigpond.net.au>
-
- * write.c (TC_FORCE_RELOCATION_SUB_SAME): Revert last change.
- * config/tc-s390.h (TC_FORCE_RELOCATION_SUB_SAME): Define.
-
---- gas/write.c 23 Jan 2003 12:51:04 -0000 1.68
-+++ gas/write.c 12 Feb 2003 22:56:38 -0000
-@@ -51,7 +51,7 @@
-
- #ifndef TC_FORCE_RELOCATION_SUB_SAME
- #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-- (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
-+ (! SEG_NORMAL (SEG))
- #endif
-
- #ifndef TC_FORCE_RELOCATION_SUB_ABS
---- gas/config/tc-s390.h 5 Sep 2002 00:01:18 -0000 1.9
-+++ gas/config/tc-s390.h 12 Feb 2003 22:56:38 -0000
-@@ -32,6 +32,10 @@ struct fix;
- #define TC_FORCE_RELOCATION(FIX) tc_s390_force_relocation(FIX)
- extern int tc_s390_force_relocation PARAMS ((struct fix *));
-
-+/* Don't resolve foo@PLT-bar to offset@PLT. */
-+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-+ (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
-+
- #define tc_fix_adjustable(X) tc_s390_fix_adjustable(X)
- extern int tc_s390_fix_adjustable PARAMS ((struct fix *));
-
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.20-gas-mips-gprel.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.20-gas-mips-gprel.patch
deleted file mode 100644
index 2b1c637d9f19..000000000000
--- a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.20-gas-mips-gprel.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naurp binutils-2.13.90.0.18.orig/gas/config/tc-mips.c binutils-2.13.90.0.18/gas/config/tc-mips.c
---- binutils-2.13.90.0.18.orig/gas/config/tc-mips.c 2003-02-28 11:22:14.000000000 -0500
-+++ binutils-2.13.90.0.18/gas/config/tc-mips.c 2003-02-28 11:23:28.000000000 -0500
-@@ -13402,7 +13402,16 @@ tc_gen_reloc (section, fixp)
- && (code == BFD_RELOC_GPREL16 || code == BFD_RELOC_MIPS16_GPREL)
- && reloc->addend != 0
- && mips_need_elf_addend_fixup (fixp))
-- reloc->addend += S_GET_VALUE (fixp->fx_addsy);
-+ {
-+ /* gbl: in o32 GPREL16 is always inplace, but in n32 and 64
-+ it isn't. I wish someone would get rid of this "fix". */
-+ reloc_howto_type *howto;
-+
-+ howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
-+ if (howto->partial_inplace) {
-+ reloc->addend += S_GET_VALUE (fixp->fx_addsy);
-+ }
-+ }
- #endif
-
- reloc->howto = bfd_reloc_type_lookup (stdoutput, code);