mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 09:49:43 +08:00
2005-06-29 Paul Brook <paul@codesourcery.com>
* bfd-in.h (_bfd_elf_provide_symbol): Update prototype. * bfd-in2.h: Regenerate. * elf32-ppc.c (ppc_elf_set_sdata_syms): Make sdata symbols section relative. * elflink.c (bfd_elf_set_symbol): Add section argument. (_bfd_elf_provide_symbol): Ditto. (_bfd_elf_provide_section_bound_symbols): Pass NULL section argument.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
2005-06-29 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
|
* bfd-in.h (_bfd_elf_provide_symbol): Update prototype.
|
||||||
|
* bfd-in2.h: Regenerate.
|
||||||
|
* elf32-ppc.c (ppc_elf_set_sdata_syms): Make sdata symbols section
|
||||||
|
relative.
|
||||||
|
* elflink.c (bfd_elf_set_symbol): Add section argument.
|
||||||
|
(_bfd_elf_provide_symbol): Ditto.
|
||||||
|
(_bfd_elf_provide_section_bound_symbols): Pass NULL section argument.
|
||||||
|
|
||||||
2005-06-27 Carlos O'Donell <carlos@systemhalted.org>
|
2005-06-27 Carlos O'Donell <carlos@systemhalted.org>
|
||||||
|
|
||||||
* bfd/elf32-hppa.c (struct elf32_hppa_stub_hash_entry):
|
* bfd/elf32-hppa.c (struct elf32_hppa_stub_hash_entry):
|
||||||
|
@ -698,7 +698,7 @@ extern struct bfd_section *_bfd_elf_tls_setup
|
|||||||
(bfd *, struct bfd_link_info *);
|
(bfd *, struct bfd_link_info *);
|
||||||
|
|
||||||
extern void _bfd_elf_provide_symbol
|
extern void _bfd_elf_provide_symbol
|
||||||
(struct bfd_link_info *, const char *, bfd_vma);
|
(struct bfd_link_info *, const char *, bfd_vma, struct bfd_section *);
|
||||||
|
|
||||||
extern void _bfd_elf_provide_section_bound_symbols
|
extern void _bfd_elf_provide_section_bound_symbols
|
||||||
(struct bfd_link_info *, struct bfd_section *sec, const char *, const char *);
|
(struct bfd_link_info *, struct bfd_section *sec, const char *, const char *);
|
||||||
|
@ -705,7 +705,7 @@ extern struct bfd_section *_bfd_elf_tls_setup
|
|||||||
(bfd *, struct bfd_link_info *);
|
(bfd *, struct bfd_link_info *);
|
||||||
|
|
||||||
extern void _bfd_elf_provide_symbol
|
extern void _bfd_elf_provide_symbol
|
||||||
(struct bfd_link_info *, const char *, bfd_vma);
|
(struct bfd_link_info *, const char *, bfd_vma, struct bfd_section *);
|
||||||
|
|
||||||
extern void _bfd_elf_provide_section_bound_symbols
|
extern void _bfd_elf_provide_section_bound_symbols
|
||||||
(struct bfd_link_info *, struct bfd_section *sec, const char *, const char *);
|
(struct bfd_link_info *, struct bfd_section *sec, const char *, const char *);
|
||||||
|
@ -5108,24 +5108,38 @@ ppc_elf_set_sdata_syms (bfd *obfd, struct bfd_link_info *info)
|
|||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
s = bfd_get_section_by_name (obfd, lsect->bss_name);
|
s = bfd_get_section_by_name (obfd, lsect->bss_name);
|
||||||
|
|
||||||
val = 0;
|
if (s)
|
||||||
if (s != NULL)
|
{
|
||||||
val = s->vma + 32768;
|
/* VxWorks executables are relocatable, so the sdata base symbols
|
||||||
lsect->sym_val = val;
|
must be section-relative. If the section is zero sized leave
|
||||||
|
them as absolute symbols to avoid creationg an unused
|
||||||
|
output section. */
|
||||||
|
val = 32768;
|
||||||
|
lsect->sym_val = val + s->vma;
|
||||||
|
if (s->size == 0)
|
||||||
|
{
|
||||||
|
val += s->vma;
|
||||||
|
s = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
val = 0;
|
||||||
|
lsect->sym_val = 0;
|
||||||
|
}
|
||||||
|
|
||||||
_bfd_elf_provide_symbol (info, lsect->sym_name, val);
|
_bfd_elf_provide_symbol (info, lsect->sym_name, val, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = bfd_get_section_by_name (obfd, ".sbss");
|
s = bfd_get_section_by_name (obfd, ".sbss");
|
||||||
val = 0;
|
_bfd_elf_provide_symbol (info, "__sbss_start", 0, NULL);
|
||||||
|
_bfd_elf_provide_symbol (info, "___sbss_start", 0, NULL);
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
val = s->vma;
|
val = s->size;
|
||||||
_bfd_elf_provide_symbol (info, "__sbss_start", val);
|
else
|
||||||
_bfd_elf_provide_symbol (info, "___sbss_start", val);
|
val = 0;
|
||||||
if (s != NULL)
|
_bfd_elf_provide_symbol (info, "__sbss_end", val, s);
|
||||||
val += s->size;
|
_bfd_elf_provide_symbol (info, "___sbss_end", val, s);
|
||||||
_bfd_elf_provide_symbol (info, "__sbss_end", val);
|
|
||||||
_bfd_elf_provide_symbol (info, "___sbss_end", val);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9792,10 +9792,11 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bfd_elf_set_symbol (struct elf_link_hash_entry *h, bfd_vma val)
|
bfd_elf_set_symbol (struct elf_link_hash_entry *h, bfd_vma val,
|
||||||
|
struct bfd_section *s)
|
||||||
{
|
{
|
||||||
h->root.type = bfd_link_hash_defined;
|
h->root.type = bfd_link_hash_defined;
|
||||||
h->root.u.def.section = bfd_abs_section_ptr;
|
h->root.u.def.section = s ? s : bfd_abs_section_ptr;
|
||||||
h->root.u.def.value = val;
|
h->root.u.def.value = val;
|
||||||
h->def_regular = 1;
|
h->def_regular = 1;
|
||||||
h->type = STT_OBJECT;
|
h->type = STT_OBJECT;
|
||||||
@ -9803,11 +9804,12 @@ bfd_elf_set_symbol (struct elf_link_hash_entry *h, bfd_vma val)
|
|||||||
h->forced_local = 1;
|
h->forced_local = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set NAME to VAL if the symbol exists and is undefined. */
|
/* Set NAME to VAL if the symbol exists and is undefined. If val is NULL
|
||||||
|
it is an absolute symbol, otherwise it is relative to that section. */
|
||||||
|
|
||||||
void
|
void
|
||||||
_bfd_elf_provide_symbol (struct bfd_link_info *info, const char *name,
|
_bfd_elf_provide_symbol (struct bfd_link_info *info, const char *name,
|
||||||
bfd_vma val)
|
bfd_vma val, struct bfd_section *s)
|
||||||
{
|
{
|
||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
|
|
||||||
@ -9815,7 +9817,7 @@ _bfd_elf_provide_symbol (struct bfd_link_info *info, const char *name,
|
|||||||
FALSE);
|
FALSE);
|
||||||
if (h != NULL && (h->root.type == bfd_link_hash_undefined
|
if (h != NULL && (h->root.type == bfd_link_hash_undefined
|
||||||
|| h->root.type == bfd_link_hash_undefweak))
|
|| h->root.type == bfd_link_hash_undefweak))
|
||||||
bfd_elf_set_symbol (h, val);
|
bfd_elf_set_symbol (h, val, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set START and END to boundaries of SEC if they exist and are
|
/* Set START and END to boundaries of SEC if they exist and are
|
||||||
@ -9868,8 +9870,8 @@ _bfd_elf_provide_section_bound_symbols (struct bfd_link_info *info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (do_start)
|
if (do_start)
|
||||||
bfd_elf_set_symbol (hs, start_val);
|
bfd_elf_set_symbol (hs, start_val, NULL);
|
||||||
|
|
||||||
if (do_end)
|
if (do_end)
|
||||||
bfd_elf_set_symbol (he, end_val);
|
bfd_elf_set_symbol (he, end_val, NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user