Merge tag 'xfs-5.11-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-microblaze.git] / tools / objtool / elf.c
index 3ddbd66..4e1d746 100644 (file)
@@ -652,7 +652,7 @@ err:
 }
 
 struct section *elf_create_section(struct elf *elf, const char *name,
-                                  size_t entsize, int nr)
+                                  unsigned int sh_flags, size_t entsize, int nr)
 {
        struct section *sec, *shstrtab;
        size_t size = entsize * nr;
@@ -712,7 +712,7 @@ struct section *elf_create_section(struct elf *elf, const char *name,
        sec->sh.sh_entsize = entsize;
        sec->sh.sh_type = SHT_PROGBITS;
        sec->sh.sh_addralign = 1;
-       sec->sh.sh_flags = SHF_ALLOC;
+       sec->sh.sh_flags = SHF_ALLOC | sh_flags;
 
 
        /* Add section name to .shstrtab (or .strtab for Clang) */
@@ -767,7 +767,7 @@ static struct section *elf_create_rel_reloc_section(struct elf *elf, struct sect
        strcpy(relocname, ".rel");
        strcat(relocname, base->name);
 
-       sec = elf_create_section(elf, relocname, sizeof(GElf_Rel), 0);
+       sec = elf_create_section(elf, relocname, 0, sizeof(GElf_Rel), 0);
        free(relocname);
        if (!sec)
                return NULL;
@@ -797,7 +797,7 @@ static struct section *elf_create_rela_reloc_section(struct elf *elf, struct sec
        strcpy(relocname, ".rela");
        strcat(relocname, base->name);
 
-       sec = elf_create_section(elf, relocname, sizeof(GElf_Rela), 0);
+       sec = elf_create_section(elf, relocname, 0, sizeof(GElf_Rela), 0);
        free(relocname);
        if (!sec)
                return NULL;