This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Non-SHF_ALLOC sections on Alpha very broken
- From: Jakub Jelinek <jakub at redhat dot com>
- To: rth at redhat dot com
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 23 Oct 2002 19:06:06 +0200
- Subject: Non-SHF_ALLOC sections on Alpha very broken
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
With the previous patch applied, strip finally doesn't die on
Alpha, but the content of non-alloced .rela.debug* sections is
broken anyway. Particularly either all or most of the relocs in
those sections are R_ALPHA_NONE (e.g. quite small library
libthread_db.so with only 0x2330 bytes of .text and way less bytes
.data/.bss has 0x8b883 bytes long .debug_info and 0x11a198 bytes
long .rela.debug_info containing only zeros).
As I don't know which exact relocs you want to keep, I haven't started
working on a patch.
The problem is that NEED_DYNREL is set even for non-dynamic relocs in
non-allocated sections, while elf64_alpha_relocate_section only emits
them for dynamic relocations:
if (dynamic_symbol_p)
{
BFD_ASSERT(h->root.dynindx != -1);
outrel.r_info = ELF64_R_INFO (h->root.dynindx, r_type);
outrel.r_addend = addend;
addend = 0, value = 0;
}
else if (r_type == R_ALPHA_DTPREL64)
{
BFD_ASSERT(tls_segment != NULL);
value -= dtp_base;
goto default_reloc;
}
else if (r_type == R_ALPHA_TPREL64)
{
BFD_ASSERT(tls_segment != NULL);
value -= dtp_base;
goto default_reloc;
}
else if (info->shared
&& r_symndx != 0
&& (input_section->flags & SEC_ALLOC))
{
if (r_type == R_ALPHA_REFLONG)
{
(*_bfd_error_handler)
(_("%s: unhandled dynamic relocation against %s"),
bfd_archive_filename (input_bfd),
h->root.root.root.string);
ret_val = false;
}
outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE);
outrel.r_addend = value;
}
else
goto default_reloc;
I hope it is the NEED_DYNREL which should be changed, not relocate_section,
or at least not all non-dynamic .debug_info relocs need to be copied,
like relocs into .debug_str section.
Jakub