- name = bfd_elf_sym_name (abfd, symtab_hdr, sym, NULL);
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB: relocation %s against thread local symbol `%s' in "
- "invalid section `%pA'"), abfd, howto->name, name, sec);
+ {
+ non_thread_local = ELF_ST_TYPE (sym->st_info) != STT_TLS;
+ name = bfd_elf_sym_name (abfd, symtab_hdr, sym, NULL);
+ if (name[0] == '\0')
+ name = "*unknown*";
+ }
+
+ switch (type)
+ {
+ case elf_x86_error_tls:
+ if (non_thread_local)
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: relocation %s against non-thread local symbol "
+ "`%s' in section `%pA'"),
+ abfd, howto->name, name, sec);
+ else
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: relocation %s against thread local symbol `%s' in "
+ "invalid section `%pA'"), abfd, howto->name, name, sec);
+ break;
+
+ case elf_x86_error_non_alloc:
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: relocation %s against symbol `%s' in non-alloc "
+ "section `%pA'"),
+ abfd, howto->name, name, sec);
+ break;
+
+ default:
+ abort ();
+ break;
+ }
+