AArch64's Setting DT_TEXTREL Is too Strict.
lin zuojian
manjian2006@gmail.com
Thu Aug 13 09:01:00 GMT 2015
More information about the Binutils mailing list
Thu Aug 13 09:01:00 GMT 2015
- Previous message (by thread): gas 0f handling
- Next message (by thread): AArch64's Setting DT_TEXTREL Is too Strict.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I find that on aarch64, DT_TEXTREL is set in dynamic section when my
object just has read-only section relocation. On
aarch64-linux-android, this will cause the following error:
text relocations (DT_TEXTREL) found in 64-bit ELF file...
And the shared objects will fail to load.
Here is the code causes trouble.
/* Find any dynamic relocs that apply to read-only sections. */
static bfd_boolean
aarch64_readonly_dynrelocs (struct elf_link_hash_entry * h, void * inf)
{
struct elf_aarch64_link_hash_entry * eh;
struct elf_dyn_relocs * p;
eh = (struct elf_aarch64_link_hash_entry *) h;
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec;
if (s != NULL && (s->flags & SEC_READONLY) != 0)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
return FALSE;
}
}
return TRUE;
}
Would it be better to change this to .text section only?
Thank you for reading.
---
Lin Zuojian
- Previous message (by thread): gas 0f handling
- Next message (by thread): AArch64's Setting DT_TEXTREL Is too Strict.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list