This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed/darwin]: Do not create an artificial section for uuid
- From: Tristan Gingold <gingold at adacore dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Tue, 15 Dec 2009 10:49:28 +0100
- Subject: [committed/darwin]: Do not create an artificial section for uuid
Hi,
the mach-o bfd back-end created an artificial section for the LC_UUID command. This was useless
because this section duplicated the load command and could confude gdb.
This patch removes this artificial section.
Tristan.
2009-12-14 Tristan Gingold <gingold@adacore.com>
* mach-o.h (bfd_mach_o_uuid_command): Remove section field.
* mach-o.c (bfd_mach_o_scan_read_uuid): Do not create a section
from this command.
---
bfd/mach-o.c | 20 --------------------
bfd/mach-o.h | 1 -
2 files changed, 0 insertions(+), 21 deletions(-)
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index e55dac4..268291d 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -2294,9 +2294,6 @@ static int
bfd_mach_o_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_uuid_command *cmd = &command->command.uuid;
- asection *bfdsec;
- char *sname;
- static const char prefix[] = "LC_UUID";
BFD_ASSERT (command->type == BFD_MACH_O_LC_UUID);
@@ -2304,23 +2301,6 @@ bfd_mach_o_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
|| bfd_bread ((void *) cmd->uuid, 16, abfd) != 16)
return -1;
- sname = bfd_alloc (abfd, strlen (prefix) + 1);
- if (sname == NULL)
- return -1;
- strcpy (sname, prefix);
-
- bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS);
- if (bfdsec == NULL)
- return -1;
-
- bfdsec->vma = 0;
- bfdsec->lma = 0;
- bfdsec->size = command->len - 8;
- bfdsec->filepos = command->offset + 8;
- bfdsec->alignment_power = 0;
-
- cmd->section = bfdsec;
-
return 0;
}
diff --git a/bfd/mach-o.h b/bfd/mach-o.h
index a597142..62f7709 100644
--- a/bfd/mach-o.h
+++ b/bfd/mach-o.h
@@ -751,7 +751,6 @@ bfd_mach_o_prebound_dylib_command;
typedef struct bfd_mach_o_uuid_command
{
unsigned char uuid[16];
- asection *section;
}
bfd_mach_o_uuid_command;
--
1.6.2