+ /* Remap the section references. */
+ {
+ unsigned int sh_info, sh_link;
+ if (flags & SHF_INFO_LINK || sh_type == SHT_REL || sh_type == SHT_RELA)
+ {
+ sh_info = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
+ shdr, sh_info, Elf_Word);
+ if (sh_info < SHN_LORESERVE
+ || sh_info > SHN_HIRESERVE)
+ sh_info = sh_map[sh_info];
+ ELF_SET_FIELD (type_functions, ei_class, Shdr,
+ shdr, sh_info, Elf_Word, sh_info);
+ }
+ sh_link = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
+ shdr, sh_link, Elf_Word);
+ if (sh_link < SHN_LORESERVE
+ || sh_link > SHN_HIRESERVE)
+ sh_link = sh_map[sh_link];
+ ELF_SET_FIELD (type_functions, ei_class, Shdr,
+ shdr, sh_link, Elf_Word, sh_link);
+ }
+ /* The debugobj doesn't contain any code, thus no trampolines.
+ Even when the original object needs trampolines, debugobj
+ doesn't. */
+ if (strcmp (name, ".note.GNU-stack") == 0)
+ flags &= ~SHF_EXECINSTR;
+ /* Clear SHF_EXCLUDE on to be preserved sections. */
+ flags &= ~SHF_EXCLUDE;