mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
ld: Don't define __start_SECNAME/__stop_SECNAME for -r
__start_SECNAME and __stop_SECNAME shouldn't be defined for "ld -r". * ldlang.c (lang_set_startof): Skip if config.build_constructors is FALSE. * testsuite/ld-elf/sizeofc.d: New file. * testsuite/ld-elf/startofc.d: Likewise.
This commit is contained in:
14
ld/ldlang.c
14
ld/ldlang.c
@ -5892,9 +5892,15 @@ lang_set_startof (void)
|
||||
{
|
||||
asection *s;
|
||||
char leading_char;
|
||||
bfd_boolean is_elf = (bfd_get_flavour (link_info.output_bfd)
|
||||
== bfd_target_elf_flavour);
|
||||
bfd_boolean is_elocatable = bfd_link_relocatable (&link_info);
|
||||
bfd_boolean is_elf;
|
||||
bfd_boolean is_relocatable;
|
||||
|
||||
if (!config.build_constructors)
|
||||
return;
|
||||
|
||||
is_elf = (bfd_get_flavour (link_info.output_bfd)
|
||||
== bfd_target_elf_flavour);
|
||||
is_relocatable = bfd_link_relocatable (&link_info);
|
||||
|
||||
leading_char = bfd_get_symbol_leading_char (link_info.output_bfd);
|
||||
|
||||
@ -5907,7 +5913,7 @@ lang_set_startof (void)
|
||||
secname = bfd_get_section_name (link_info.output_bfd, s);
|
||||
buf = (char *) xmalloc (10 + strlen (secname));
|
||||
|
||||
if (!is_elocatable)
|
||||
if (!is_relocatable)
|
||||
{
|
||||
sprintf (buf, ".startof.%s", secname);
|
||||
h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE,
|
||||
|
Reference in New Issue
Block a user