diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index daad2031902..6d55c745837 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -3222,8 +3222,8 @@ extern struct elf_link_hash_entry * _bfd_elf_get_link_hash_entry extern asection *_bfd_get_local_sym_section (struct elf_reloc_cookie *, unsigned int) ATTRIBUTE_HIDDEN; -/* Large common section. */ -extern asection _bfd_elf_large_com_section; +/* Large common section (x86 only). */ +extern asection bfd_elf_large_com_section; /* Hash for local symbol with the first section id, ID, in the input file and the local symbol index, SYM. */ diff --git a/bfd/elf.c b/bfd/elf.c index 5e3ec17003e..e6e6a348eca 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -13449,15 +13449,6 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, return n; } -/* It is only used by x86-64 so far. - ??? This repeats *COM* id of zero. sec->id is supposed to be unique, - but current usage would allow all of _bfd_std_section to be zero. */ -static const asymbol lcomm_sym - = GLOBAL_SYM_INIT ("LARGE_COMMON", &_bfd_elf_large_com_section); -asection _bfd_elf_large_com_section - = BFD_FAKE_SECTION (_bfd_elf_large_com_section, &lcomm_sym, - "LARGE_COMMON", 0, SEC_IS_COMMON); - bool _bfd_elf_final_write_processing (bfd *abfd) { diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 199fe3bf139..26c6f0efc4c 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1961,7 +1961,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd, else if (isym->st_shndx == SHN_COMMON) tsec = bfd_com_section_ptr; else if (isym->st_shndx == SHN_X86_64_LCOMMON) - tsec = &_bfd_elf_large_com_section; + tsec = &bfd_elf_large_com_section; else tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); } @@ -6055,7 +6055,7 @@ static bool elf_x86_64_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, int *index_return) { - if (sec == &_bfd_elf_large_com_section) + if (sec == &bfd_elf_large_com_section) { *index_return = SHN_X86_64_LCOMMON; return true; @@ -6074,7 +6074,7 @@ elf_x86_64_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, switch (elfsym->internal_elf_sym.st_shndx) { case SHN_X86_64_LCOMMON: - asym->section = &_bfd_elf_large_com_section; + asym->section = &bfd_elf_large_com_section; asym->value = elfsym->internal_elf_sym.st_size; /* Common symbol doesn't set BSF_GLOBAL. */ asym->flags &= ~BSF_GLOBAL; @@ -6104,7 +6104,7 @@ elf_x86_64_common_section (asection *sec) if ((elf_section_flags (sec) & SHF_X86_64_LARGE) == 0) return bfd_com_section_ptr; else - return &_bfd_elf_large_com_section; + return &bfd_elf_large_com_section; } static bool diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 842d600d5e4..94e22d4d04e 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -29,6 +29,14 @@ #define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1" #define ELFX32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1" +/* ??? This repeats *COM* id of zero. sec->id is supposed to be unique, + but current usage would allow all of _bfd_std_section to be zero. */ +static const asymbol lcomm_sym + = GLOBAL_SYM_INIT ("LARGE_COMMON", &bfd_elf_large_com_section); +asection bfd_elf_large_com_section + = BFD_FAKE_SECTION (bfd_elf_large_com_section, &lcomm_sym, + "LARGE_COMMON", 0, SEC_IS_COMMON); + bool _bfd_x86_elf_mkobject (bfd *abfd) { @@ -1179,7 +1187,7 @@ _bfd_x86_elf_link_relax_section (bfd *abfd ATTRIBUTE_UNUSED, case SHN_X86_64_LCOMMON: if (!is_x86_64) abort (); - sec = &_bfd_elf_large_com_section; + sec = &bfd_elf_large_com_section; break; default: sec = bfd_section_from_elf_index (abfd, isym->st_shndx); diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 44c8ae3a25b..eb282bff43c 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -18761,7 +18761,7 @@ handle_large_common (int small ATTRIBUTE_UNUSED) subseg_set (seg, subseg); } - elf_com_section_ptr = &_bfd_elf_large_com_section; + elf_com_section_ptr = &bfd_elf_large_com_section; bss_section = lbss_section; s_comm_internal (0, elf_common_parse);