+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.
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. */
/* 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;
+2015-08-19 Alan Modra <amodra@gmail.com>
+
+ * 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.
+
2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
* ld/ldctor.c: Replace shared, executable, relocatable and pie
if (*optarg == 'S')
{
link_info.type = type_dll;
- link_info.pic = TRUE;
++optarg;
}
if (*optarg == '\0' || optarg[1] == '\0')
/* def_file_print (stdout, pe_def_file); */
if (pe_def_file->is_dll == 1)
- {
- link_info.type = type_dll;
- link_info.pic = 1;
- }
+ link_info.type = type_dll;
if (pe_def_file->base_address != (bfd_vma)(-1))
{
/* def_file_print (stdout, pep_def_file); */
if (pep_def_file->is_dll == 1)
- {
- link_info.type = type_dll;
- link_info.pic = 1;
- }
+ link_info.type = type_dll;
if (pep_def_file->base_address != (bfd_vma)(-1))
{
if (! found_assign)
{
link_info.type = type_dll;
- link_info.pic = TRUE;
break;
}
}
einfo (_("%P%F: -r and -shared may not be used together\n"));
link_info.type = type_dll;
- link_info.pic = TRUE;
/* When creating a shared library, the default
behaviour is to ignore any unresolved references. */
if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
if (bfd_link_relocatable (&link_info))
einfo (_("%P%F: -r and -pie may not be used together\n"));
- link_info.type = type_executable;
- link_info.pic = TRUE;
+ link_info.type = type_pie;
}
else
einfo (_("%P%F: -pie not supported\n"));
TVU(val) = major * 100 + minor;
break;
case LDPT_LINKER_OUTPUT:
- TVU(val) = (bfd_link_relocatable (&link_info)
- ? LDPO_REL
- : (bfd_link_executable (&link_info)
- ? (bfd_link_pic (&link_info) ? LDPO_PIE : LDPO_EXEC)
- : LDPO_DYN));
+ TVU(val) = (bfd_link_relocatable (&link_info) ? LDPO_REL
+ : bfd_link_pde (&link_info) ? LDPO_EXEC
+ : bfd_link_pie (&link_info) ? LDPO_PIE
+ : LDPO_DYN);
break;
case LDPT_OUTPUT_NAME:
TVU(string) = output_filename;