aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-02-21 04:35:22 +0000
committerAlan Modra <amodra@gmail.com>2013-02-21 04:35:22 +0000
commitc03551323c0425db9b677ac2618e43854ac56064 (patch)
tree1ebc99fe420dae1ce441fd715fd4bc8855a10d5a /ld
parent228e534f16219c61a3f2d1aea96cc5d78215b2d4 (diff)
downloadgdb-c03551323c0425db9b677ac2618e43854ac56064.zip
gdb-c03551323c0425db9b677ac2618e43854ac56064.tar.gz
gdb-c03551323c0425db9b677ac2618e43854ac56064.tar.bz2
bfd/
* elf-bfd.h (struct elf_build_id): Extracted from.. (struct elf_build_id_info): ..here. Delete. (struct output_elf_obj_tdata): New, extracted from.. (struct elf_obj_tdata): ..here. Reorganize for better packing. Add "o" field. (elf_program_header_size): Reference tdata->o. (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker, elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec, elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise. * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata when opening bfd in any mode that might write. (_bfd_elf_write_object_contents): Use build_id field in output_elf_obj_tdata. (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test. (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes. gdb/ * elfread.c (build_id_bfd_get): Adjust for elf_tdata changes. ld/ * emultempl/elf32.em (write_build_id, setup_build_id): Adjust for elf_tdata changes.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf32.em21
2 files changed, 13 insertions, 13 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 429e4da..95d466d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2013-02-21 Alan Modra <amodra@gmail.com>
+ * emultempl/elf32.em (write_build_id, setup_build_id): Adjust
+ for elf_tdata changes.
+
+2013-02-21 Alan Modra <amodra@gmail.com>
+
* emultempl/elf-generic.em: Use newly defined elf_obj_tdata
accessor macros.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index ad5d98c..32662e5 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -960,8 +960,8 @@ write_build_id (bfd *abfd)
Elf_External_Note *e_note;
typedef void (*sum_fn) (const void *, size_t, void *);
- style = t->build_id->u.o.style;
- asec = t->build_id->u.o.sec;
+ style = t->o->build_id.style;
+ asec = t->o->build_id.sec;
if (bfd_is_abs_section (asec->output_section))
{
einfo (_("%P: warning: .note.gnu.build-id section discarded,"
@@ -1068,17 +1068,12 @@ setup_build_id (bfd *ibfd)
if (s != NULL && bfd_set_section_alignment (ibfd, s, 2))
{
struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd);
- t->build_id = bfd_alloc (link_info.output_bfd, sizeof (t->build_id->u.o));
- if (t->build_id != NULL)
- {
- t->build_id->u.o.zero = 0;
- t->build_id->u.o.after_write_object_contents = &write_build_id;
- t->build_id->u.o.style = emit_note_gnu_build_id;
- t->build_id->u.o.sec = s;
- elf_section_type (s) = SHT_NOTE;
- s->size = size;
- return TRUE;
- }
+ t->o->build_id.after_write_object_contents = &write_build_id;
+ t->o->build_id.style = emit_note_gnu_build_id;
+ t->o->build_id.sec = s;
+ elf_section_type (s) = SHT_NOTE;
+ s->size = size;
+ return TRUE;
}
einfo ("%P: warning: Cannot create .note.gnu.build-id section,"