From fac7bd6475c4058e7c1e0df29dac50579e427b34 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Tue, 20 Mar 2018 10:55:53 +0100 Subject: [PATCH] [ARM] FDPIC: Make _GLOBAL_OFFSET_TABLE_ a relative symbol MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2018-04-25 Christophe Lyon Mickaël Guêné bfd/ * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle _GLOBAL_OFFSET_TABLE_ in FDPIC mode. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-arm.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 766341a54f8..84d0891086f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2018-04-25 Christophe Lyon + Mickaël Guêné + + * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle + _GLOBAL_OFFSET_TABLE_ in FDPIC mode. + 2018-04-25 Christophe Lyon Mickaël Guêné diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index c2f48046200..b72e397bcb4 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -17086,10 +17086,10 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. On VxWorks, - the _GLOBAL_OFFSET_TABLE_ symbol is not absolute: it is relative - to the ".got" section. */ + and for FDPIC, the _GLOBAL_OFFSET_TABLE_ symbol is not absolute: + it is relative to the ".got" section. */ if (h == htab->root.hdynamic - || (!htab->vxworks_p && h == htab->root.hgot)) + || (!htab->fdpic_p && !htab->vxworks_p && h == htab->root.hgot)) sym->st_shndx = SHN_ABS; return TRUE; -- 2.30.2