This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix ld -z now
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: Ulrich Drepper <drepper at redhat dot com>
- Date: Sat, 21 Feb 2004 19:09:04 +0100
- Subject: [PATCH] Fix ld -z now
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
ld -z now without --enable-new-dtags only creates DT_FLAGS_1 with DF_1_NOW
(Sun extension) which is not recognized by all dynamic linkers.
If -z now --enable-new-dtags, it also creates DT_FLAGS with DF_BIND_NOW set.
This patch changes the case where --enable-new-dtags is not specified to
create DT_BIND_NOW dynamic tag instead.
Ok to commit?
2004-02-21 Jakub Jelinek <jakub@redhat.com>
* elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
--- bfd/elflink.h.jj 2004-02-18 20:06:00.000000000 +0100
+++ bfd/elflink.h 2004-02-21 21:08:36.904730248 +0100
@@ -2434,6 +2434,11 @@ NAME(bfd_elf,size_dynamic_sections) (bfd
if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags))
return FALSE;
}
+ else if (info->flags & DF_BIND_NOW)
+ {
+ if (! elf_add_dynamic_entry (info, DT_BIND_NOW, 0))
+ return FALSE;
+ }
if (info->flags_1)
{
Jakub