mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 10:34:21 +08:00
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma,
bfd_get_section_lma, bfd_get_section_alignment, bfd_get_section_flags, bfd_get_section_userdata): Rewrite macros in order to use the `bfd' argument. * bfd-in2.h: Regenerate. * elf-vxworks.c (elf_vxworks_finish_dynamic_entry): Pass proper `bfd' as the first argument for `bfd_get_section_alignment'. * elf32-arm.c (create_ifunc_sections): Likewise, for `bfd_set_section_alignment'. * elf32-m32r.c (m32r_elf_relocate_section): Likewise, for `bfd_get_section_name'. * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relocate_section): Likewise. * elf64-mmix.c (mmix_final_link_relocate): Likewise, for `bfd_get_section_vma'. * elf64-ppc.c (create_linkage_sections): Likewise, for `bfd_set_section_alignment'. * emultempl/m68hc1xelf.em (hook_in_stub): Pass proper `bfd' as the first argument for `bfd_get_section_name'. * config/tc-alpha.c (maybe_set_gp): Pass proper `bfd' as the first argument for `bfd_get_section_vma'.
This commit is contained in:
@ -1,3 +1,24 @@
|
|||||||
|
2012-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
|
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma,
|
||||||
|
bfd_get_section_lma, bfd_get_section_alignment,
|
||||||
|
bfd_get_section_flags, bfd_get_section_userdata): Rewrite macros
|
||||||
|
in order to use the `bfd' argument.
|
||||||
|
* bfd-in2.h: Regenerate.
|
||||||
|
* elf-vxworks.c (elf_vxworks_finish_dynamic_entry): Pass proper `bfd'
|
||||||
|
as the first argument for `bfd_get_section_alignment'.
|
||||||
|
* elf32-arm.c (create_ifunc_sections): Likewise, for
|
||||||
|
`bfd_set_section_alignment'.
|
||||||
|
* elf32-m32r.c (m32r_elf_relocate_section): Likewise, for
|
||||||
|
`bfd_get_section_name'.
|
||||||
|
* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
|
||||||
|
* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
|
||||||
|
(ppc_elf_relocate_section): Likewise.
|
||||||
|
* elf64-mmix.c (mmix_final_link_relocate): Likewise, for
|
||||||
|
`bfd_get_section_vma'.
|
||||||
|
* elf64-ppc.c (create_linkage_sections): Likewise, for
|
||||||
|
`bfd_set_section_alignment'.
|
||||||
|
|
||||||
2012-05-16 Georg-Johann Lay <avr@gjlay.de>
|
2012-05-16 Georg-Johann Lay <avr@gjlay.de>
|
||||||
|
|
||||||
PR target/13503
|
PR target/13503
|
||||||
|
13
bfd/bfd-in.h
13
bfd/bfd-in.h
@ -273,18 +273,19 @@ alent;
|
|||||||
|
|
||||||
typedef struct bfd_section *sec_ptr;
|
typedef struct bfd_section *sec_ptr;
|
||||||
|
|
||||||
#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
|
#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
|
||||||
#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
|
#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
|
||||||
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
|
#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
|
||||||
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
|
#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
|
||||||
|
(ptr)->alignment_power)
|
||||||
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
||||||
#define bfd_section_size(bfd, ptr) ((ptr)->size)
|
#define bfd_section_size(bfd, ptr) ((ptr)->size)
|
||||||
#define bfd_get_section_size(ptr) ((ptr)->size)
|
#define bfd_get_section_size(ptr) ((ptr)->size)
|
||||||
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
||||||
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
||||||
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
||||||
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
|
#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
|
||||||
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
|
#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
|
||||||
|
|
||||||
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
||||||
|
|
||||||
|
@ -280,18 +280,19 @@ alent;
|
|||||||
|
|
||||||
typedef struct bfd_section *sec_ptr;
|
typedef struct bfd_section *sec_ptr;
|
||||||
|
|
||||||
#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
|
#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
|
||||||
#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
|
#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
|
||||||
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
|
#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
|
||||||
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
|
#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
|
||||||
|
(ptr)->alignment_power)
|
||||||
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
||||||
#define bfd_section_size(bfd, ptr) ((ptr)->size)
|
#define bfd_section_size(bfd, ptr) ((ptr)->size)
|
||||||
#define bfd_get_section_size(ptr) ((ptr)->size)
|
#define bfd_get_section_size(ptr) ((ptr)->size)
|
||||||
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
||||||
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
||||||
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
||||||
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
|
#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
|
||||||
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
|
#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
|
||||||
|
|
||||||
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* VxWorks support for ELF
|
/* VxWorks support for ELF
|
||||||
Copyright 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
Copyright 2005, 2006, 2007, 2009, 2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
|
||||||
@ -280,7 +280,8 @@ elf_vxworks_finish_dynamic_entry (bfd *output_bfd, Elf_Internal_Dyn *dyn)
|
|||||||
case DT_VX_WRS_TLS_DATA_ALIGN:
|
case DT_VX_WRS_TLS_DATA_ALIGN:
|
||||||
sec = bfd_get_section_by_name (output_bfd, ".tls_data");
|
sec = bfd_get_section_by_name (output_bfd, ".tls_data");
|
||||||
dyn->d_un.d_val
|
dyn->d_un.d_val
|
||||||
= (bfd_size_type)1 << bfd_get_section_alignment (abfd, sec);
|
= (bfd_size_type)1 << bfd_get_section_alignment (output_bfd,
|
||||||
|
sec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DT_VX_WRS_TLS_VARS_START:
|
case DT_VX_WRS_TLS_VARS_START:
|
||||||
|
@ -3258,7 +3258,7 @@ create_ifunc_sections (struct bfd_link_info *info)
|
|||||||
s = bfd_make_section_with_flags (dynobj, ".iplt",
|
s = bfd_make_section_with_flags (dynobj, ".iplt",
|
||||||
flags | SEC_READONLY | SEC_CODE);
|
flags | SEC_READONLY | SEC_CODE);
|
||||||
if (s == NULL
|
if (s == NULL
|
||||||
|| !bfd_set_section_alignment (abfd, s, bed->plt_alignment))
|
|| !bfd_set_section_alignment (dynobj, s, bed->plt_alignment))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
htab->root.iplt = s;
|
htab->root.iplt = s;
|
||||||
}
|
}
|
||||||
@ -3268,7 +3268,7 @@ create_ifunc_sections (struct bfd_link_info *info)
|
|||||||
s = bfd_make_section_with_flags (dynobj, RELOC_SECTION (htab, ".iplt"),
|
s = bfd_make_section_with_flags (dynobj, RELOC_SECTION (htab, ".iplt"),
|
||||||
flags | SEC_READONLY);
|
flags | SEC_READONLY);
|
||||||
if (s == NULL
|
if (s == NULL
|
||||||
|| !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
|
|| !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
htab->root.irelplt = s;
|
htab->root.irelplt = s;
|
||||||
}
|
}
|
||||||
|
@ -3007,7 +3007,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
|||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
BFD_ASSERT (sec != NULL);
|
BFD_ASSERT (sec != NULL);
|
||||||
name = bfd_get_section_name (abfd, sec);
|
name = bfd_get_section_name (sec->owner, sec);
|
||||||
|
|
||||||
if ( strcmp (name, ".sdata") == 0
|
if ( strcmp (name, ".sdata") == 0
|
||||||
|| strcmp (name, ".sbss") == 0
|
|| strcmp (name, ".sbss") == 0
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Xilinx MicroBlaze-specific support for 32-bit ELF
|
/* Xilinx MicroBlaze-specific support for 32-bit ELF
|
||||||
|
|
||||||
Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
|
||||||
@ -839,7 +839,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
|
|||||||
/* Only relocate if the symbol is defined. */
|
/* Only relocate if the symbol is defined. */
|
||||||
if (sec)
|
if (sec)
|
||||||
{
|
{
|
||||||
name = bfd_get_section_name (abfd, sec);
|
name = bfd_get_section_name (sec->owner, sec);
|
||||||
|
|
||||||
if (strcmp (name, ".sdata2") == 0
|
if (strcmp (name, ".sdata2") == 0
|
||||||
|| strcmp (name, ".sbss2") == 0)
|
|| strcmp (name, ".sbss2") == 0)
|
||||||
@ -868,7 +868,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
|
|||||||
bfd_get_filename (input_bfd),
|
bfd_get_filename (input_bfd),
|
||||||
sym_name,
|
sym_name,
|
||||||
microblaze_elf_howto_table[(int) r_type]->name,
|
microblaze_elf_howto_table[(int) r_type]->name,
|
||||||
bfd_get_section_name (abfd, sec));
|
bfd_get_section_name (sec->owner, sec));
|
||||||
/*bfd_set_error (bfd_error_bad_value); ??? why? */
|
/*bfd_set_error (bfd_error_bad_value); ??? why? */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
continue;
|
continue;
|
||||||
@ -884,7 +884,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
|
|||||||
/* Only relocate if the symbol is defined. */
|
/* Only relocate if the symbol is defined. */
|
||||||
if (sec)
|
if (sec)
|
||||||
{
|
{
|
||||||
name = bfd_get_section_name (abfd, sec);
|
name = bfd_get_section_name (sec->owner, sec);
|
||||||
|
|
||||||
if (strcmp (name, ".sdata") == 0
|
if (strcmp (name, ".sdata") == 0
|
||||||
|| strcmp (name, ".sbss") == 0)
|
|| strcmp (name, ".sbss") == 0)
|
||||||
@ -913,7 +913,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
|
|||||||
bfd_get_filename (input_bfd),
|
bfd_get_filename (input_bfd),
|
||||||
sym_name,
|
sym_name,
|
||||||
microblaze_elf_howto_table[(int) r_type]->name,
|
microblaze_elf_howto_table[(int) r_type]->name,
|
||||||
bfd_get_section_name (abfd, sec));
|
bfd_get_section_name (sec->owner, sec));
|
||||||
/*bfd_set_error (bfd_error_bad_value); ??? why? */
|
/*bfd_set_error (bfd_error_bad_value); ??? why? */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
continue;
|
continue;
|
||||||
|
@ -6309,7 +6309,8 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
|||||||
{
|
{
|
||||||
/* Strip these too. */
|
/* Strip these too. */
|
||||||
}
|
}
|
||||||
else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
|
else if (CONST_STRNEQ (bfd_get_section_name (htab->elf.dynobj, s),
|
||||||
|
".rela"))
|
||||||
{
|
{
|
||||||
if (s->size != 0)
|
if (s->size != 0)
|
||||||
{
|
{
|
||||||
@ -8331,8 +8332,10 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
unresolved_reloc = TRUE;
|
unresolved_reloc = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
BFD_ASSERT (strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
|
BFD_ASSERT (strcmp (bfd_get_section_name (sec->owner, sec),
|
||||||
|| strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0);
|
".got") == 0
|
||||||
|
|| strcmp (bfd_get_section_name (sec->owner, sec),
|
||||||
|
".cgot") == 0);
|
||||||
|
|
||||||
addend -= sec->output_section->vma + sec->output_offset + 0x8000;
|
addend -= sec->output_section->vma + sec->output_offset + 0x8000;
|
||||||
break;
|
break;
|
||||||
@ -8382,7 +8385,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
}
|
}
|
||||||
addend -= SYM_VAL (sda);
|
addend -= SYM_VAL (sda);
|
||||||
|
|
||||||
name = bfd_get_section_name (abfd, sec->output_section);
|
name = bfd_get_section_name (output_bfd, sec->output_section);
|
||||||
if (! ((CONST_STRNEQ (name, ".sdata")
|
if (! ((CONST_STRNEQ (name, ".sdata")
|
||||||
&& (name[6] == 0 || name[6] == '.'))
|
&& (name[6] == 0 || name[6] == '.'))
|
||||||
|| (CONST_STRNEQ (name, ".sbss")
|
|| (CONST_STRNEQ (name, ".sbss")
|
||||||
@ -8414,7 +8417,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
}
|
}
|
||||||
addend -= SYM_VAL (sda);
|
addend -= SYM_VAL (sda);
|
||||||
|
|
||||||
name = bfd_get_section_name (abfd, sec->output_section);
|
name = bfd_get_section_name (output_bfd, sec->output_section);
|
||||||
if (! (CONST_STRNEQ (name, ".sdata2")
|
if (! (CONST_STRNEQ (name, ".sdata2")
|
||||||
|| CONST_STRNEQ (name, ".sbss2")))
|
|| CONST_STRNEQ (name, ".sbss2")))
|
||||||
{
|
{
|
||||||
@ -8487,7 +8490,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = bfd_get_section_name (abfd, sec->output_section);
|
name = bfd_get_section_name (output_bfd, sec->output_section);
|
||||||
if (((CONST_STRNEQ (name, ".sdata")
|
if (((CONST_STRNEQ (name, ".sdata")
|
||||||
&& (name[6] == 0 || name[6] == '.'))
|
&& (name[6] == 0 || name[6] == '.'))
|
||||||
|| (CONST_STRNEQ (name, ".sbss")
|
|| (CONST_STRNEQ (name, ".sbss")
|
||||||
@ -8579,7 +8582,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = bfd_get_section_name (abfd, sec->output_section);
|
name = bfd_get_section_name (output_bfd, sec->output_section);
|
||||||
if (((CONST_STRNEQ (name, ".sdata")
|
if (((CONST_STRNEQ (name, ".sdata")
|
||||||
&& (name[6] == 0 || name[6] == '.'))
|
&& (name[6] == 0 || name[6] == '.'))
|
||||||
|| (CONST_STRNEQ (name, ".sbss")
|
|| (CONST_STRNEQ (name, ".sbss")
|
||||||
|
@ -1771,7 +1771,9 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
|
|||||||
first_global = 255;
|
first_global = 255;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
first_global = bfd_get_section_vma (abfd, regsec) / 8;
|
first_global
|
||||||
|
= bfd_get_section_vma (input_section->output_section->owner,
|
||||||
|
regsec) / 8;
|
||||||
if (strcmp (bfd_get_section_name (symsec->owner, symsec),
|
if (strcmp (bfd_get_section_name (symsec->owner, symsec),
|
||||||
MMIX_REG_CONTENTS_SECTION_NAME) == 0)
|
MMIX_REG_CONTENTS_SECTION_NAME) == 0)
|
||||||
{
|
{
|
||||||
|
@ -4245,7 +4245,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
|
|||||||
".eh_frame",
|
".eh_frame",
|
||||||
flags);
|
flags);
|
||||||
if (htab->glink_eh_frame == NULL
|
if (htab->glink_eh_frame == NULL
|
||||||
|| !bfd_set_section_alignment (abfd, htab->glink_eh_frame, 2))
|
|| !bfd_set_section_alignment (dynobj, htab->glink_eh_frame, 2))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2012-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
|
* config/tc-alpha.c (maybe_set_gp): Pass proper `bfd'
|
||||||
|
as the first argument for `bfd_get_section_vma'.
|
||||||
|
|
||||||
2012-05-16 Alberto Garcia <agarcia@igalia.com>
|
2012-05-16 Alberto Garcia <agarcia@igalia.com>
|
||||||
|
|
||||||
PR gas/14082
|
PR gas/14082
|
||||||
|
@ -5302,7 +5302,7 @@ maybe_set_gp (asection *sec)
|
|||||||
|
|
||||||
if (!sec)
|
if (!sec)
|
||||||
return;
|
return;
|
||||||
vma = bfd_get_section_vma (foo, sec);
|
vma = bfd_get_section_vma (sec->owner, sec);
|
||||||
if (vma && vma < alpha_gp_value)
|
if (vma && vma < alpha_gp_value)
|
||||||
alpha_gp_value = vma;
|
alpha_gp_value = vma;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2012-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
|
* emultempl/m68hc1xelf.em (hook_in_stub): Pass proper `bfd'
|
||||||
|
as the first argument for `bfd_get_section_name'.
|
||||||
|
|
||||||
2012-05-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
2012-05-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
PR ld/14069
|
PR ld/14069
|
||||||
|
@ -204,9 +204,9 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
|
|||||||
|
|
||||||
case lang_input_section_enum:
|
case lang_input_section_enum:
|
||||||
if (l->input_section.section == info->input_section
|
if (l->input_section.section == info->input_section
|
||||||
|| strcmp (bfd_get_section_name (output_section,
|
|| strcmp (bfd_get_section_name (l->input_section.section->owner,
|
||||||
l->input_section.section),
|
l->input_section.section),
|
||||||
bfd_get_section_name (output_section,
|
bfd_get_section_name (info->input_section->owner,
|
||||||
info->input_section)) == 0)
|
info->input_section)) == 0)
|
||||||
{
|
{
|
||||||
/* We've found our section. Insert the stub immediately
|
/* We've found our section. Insert the stub immediately
|
||||||
|
Reference in New Issue
Block a user