diff options
Diffstat (limited to 'contrib/binutils/bfd/elflink.c')
-rw-r--r-- | contrib/binutils/bfd/elflink.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index 8039b4f..bfaf44b 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -41,9 +41,17 @@ _bfd_elf_create_got_section (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -89,7 +97,6 @@ _bfd_elf_create_got_section (abfd, info) return true; } - /* Create dynamic sections when linking against a dynamic object. */ boolean @@ -104,9 +111,17 @@ _bfd_elf_create_dynamic_sections (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and @@ -147,7 +162,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) return false; } - s = bfd_make_section (abfd, + s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) @@ -183,9 +198,9 @@ _bfd_elf_create_dynamic_sections (abfd, info) copy relocs. */ if (! info->shared) { - s = bfd_make_section (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss")); + s = bfd_make_section (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -196,7 +211,6 @@ _bfd_elf_create_dynamic_sections (abfd, info) return true; } - /* Record a new dynamic symbol. We record the dynamic symbols as we read the input files, since we need to have a list of all of them before we can determine the final sizes of the output sections. @@ -482,7 +496,6 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) return lsect; } - /* Find a linker generated pointer with a given addend and type. */ @@ -500,7 +513,6 @@ _bfd_elf_find_pointer_linker_section (linker_pointers, addend, which) return (elf_linker_section_pointers_t *)0; } - /* Make the .rela section corresponding to the generated linker section. */ |