aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-19 12:32:54 +0930
committerAlan Modra <amodra@gmail.com>2015-08-19 12:53:54 +0930
commit64d94ba01a4f56ac10bb277e66bb00d82bd97f10 (patch)
tree62c874d41a10602671ff90819aef826e06ed57c5 /include
parent3cbc1e5e68341e53a03fe7e9d38fc02e0d78c418 (diff)
downloadgdb-64d94ba01a4f56ac10bb277e66bb00d82bd97f10.zip
gdb-64d94ba01a4f56ac10bb277e66bb00d82bd97f10.tar.gz
gdb-64d94ba01a4f56ac10bb277e66bb00d82bd97f10.tar.bz2
Remove link_info.pic
Adding type_pie to output_type allows us to remove link_info.pic and with some reordering of the enum, produces better code. include/ * bfdlink.h (enum output_type): Delete type_executable, add type_pde and type_pie. Reorder. (struct bfd_link_info): Delete pic field. (bfd_link_executable, bfd_link_pde, bfd_link_pie, bfd_link_pic): Adjust. ld/ * emultempl/aix.em: Don't set link_info.pic. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/sunos.em: Likewise. * lexsup.c (parse_args): Likewise. Set type_pie for -pie. * plugin.c (set_tv_header <LDPT_LINKER_OUTPUT>): Simplify.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/bfdlink.h18
2 files changed, 14 insertions, 11 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 5197abf..e4dad82 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,12 @@
2015-08-19 Alan Modra <amodra@gmail.com>
+ * bfdlink.h (enum output_type): Delete type_executable, add type_pde
+ and type_pie. Reorder.
+ (struct bfd_link_info): Delete pic field.
+ (bfd_link_executable, bfd_link_pde, bfd_link_pie, bfd_link_pic): Adjust.
+
+2015-08-19 Alan Modra <amodra@gmail.com>
+
* bfdlink.h (bfd_link_pde): Define.
2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 62309a5..458a768 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -263,19 +263,18 @@ struct bfd_elf_version_tree;
enum output_type
{
- type_executable = 0,
+ type_pde,
+ type_relocatable,
+ type_pie,
type_dll,
- type_relocatable
};
-#define bfd_link_executable(info) ((info)->type == type_executable)
+#define bfd_link_pde(info) ((info)->type == type_pde)
#define bfd_link_dll(info) ((info)->type == type_dll)
#define bfd_link_relocatable(info) ((info)->type == type_relocatable)
-#define bfd_link_pic(info) (info)->pic
-#define bfd_link_pie(info) (bfd_link_executable (info) \
- && bfd_link_pic (info))
-#define bfd_link_pde(info) (bfd_link_executable (info) \
- && !bfd_link_pic (info))
+#define bfd_link_pie(info) ((info)->type == type_pie)
+#define bfd_link_executable(info) (bfd_link_pde (info) || bfd_link_pie (info))
+#define bfd_link_pic(info) (bfd_link_dll (info) || bfd_link_pie (info))
/* This structure holds all the information needed to communicate
between BFD and the linker when doing a link. */
@@ -285,9 +284,6 @@ struct bfd_link_info
/* Output type. */
ENUM_BITFIELD (output_type) type : 2;
- /* TRUE if BFD should generate a position independent object. */
- unsigned int pic : 1;
-
/* TRUE if BFD should pre-bind symbols in a shared object. */
unsigned int symbolic: 1;