diff options
author | Philip Blundell <pb@nexus.co.uk> | 1999-05-26 01:29:10 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-05-25 19:29:10 -0600 |
commit | 84306176023e6f75c964d353ca4a8c7f28ba8da3 (patch) | |
tree | 22b6221b6ec100abee36001d1ef8b167281ad425 /gcc | |
parent | d238a2376dc0baff5a4bb0ed3a475e655402b6f1 (diff) | |
download | gcc-84306176023e6f75c964d353ca4a8c7f28ba8da3.zip gcc-84306176023e6f75c964d353ca4a8c7f28ba8da3.tar.gz gcc-84306176023e6f75c964d353ca4a8c7f28ba8da3.tar.bz2 |
arm.h (NEED_PLT_GOT): Fix mistake in last change.
�
* arm.h (NEED_PLT_GOT): Fix mistake in last change.
(GOT_PCREL): New macro. Define to 1 if not already defined.
* arm/elf.h (GOT_PCREL): Define to 0.
* arm.c (arm_finalize_pic): Take into account the setting of
GOT_PCREL.
From-SVN: r27156
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 5 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 15 | ||||
-rw-r--r-- | gcc/config/arm/elf.h | 3 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 663c118..9bd4023 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Wed May 26 02:19:31 1999 Philip Blundell <pb@nexus.co.uk> + + * arm.h (NEED_PLT_GOT): Fix mistake in last change. + (GOT_PCREL): New macro. Define to 1 if not already defined. + * arm/elf.h (GOT_PCREL): Define to 0. + * arm.c (arm_finalize_pic): Take into account the setting of + GOT_PCREL. + Tue May 25 14:06:06 1999 Jeffrey A Law (law@cygnus.com) * output.h (STRIP_NAME_ENCODING): Provide default definition. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index b60f552..eb18be7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1566,8 +1566,11 @@ arm_finalize_pic () /* On the ARM the PC register contains 'dot + 8' at the time of the addition. */ pic_tmp = plus_constant (gen_rtx_LABEL_REF (Pmode, l1), 8); - pic_tmp2 = gen_rtx_CONST (VOIDmode, + if (GOT_PCREL) + pic_tmp2 = gen_rtx_CONST (VOIDmode, gen_rtx_PLUS (Pmode, global_offset_table, pc_rtx)); + else + pic_tmp2 = gen_rtx_CONST (VOIDmode, global_offset_table); pic_rtx = gen_rtx_CONST (Pmode, gen_rtx_MINUS (Pmode, pic_tmp2, pic_tmp)); diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 6b40bc5..87a141a 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -483,6 +483,21 @@ extern int arm_is_6_or_7; #ifndef NEED_PLT_GOT #define NEED_PLT_GOT 0 #endif + +/* Nonzero if we need to refer to the GOT with a PC-relative + offset. In other words, generate + + .word _GLOBAL_OFFSET_TABLE_ - [. - (.Lxx + 8)] + + rather than + + .word _GLOBAL_OFFSET_TABLE_ - (.Lxx + 8) + + The default is true, which matches NetBSD. Subtargets can + override this if required. */ +#ifndef GOT_PCREL +#define GOT_PCREL 1 +#endif /* Target machine storage Layout. */ diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index d2ba8bb..b282004 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -338,4 +338,7 @@ do { \ /* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */ #define NEED_PLT_GOT flag_pic +/* The ELF assembler handles GOT addressing differently to NetBSD. */ +#define GOT_PCREL 0 + #include "arm/aout.h" |