mirror of https://github.com/acidanthera/audk.git
BaseTools GenFw: Keep read only alloc section as text when convert ELF
This is the fix of the regression issue at c6b872c6
.
Based on ELF spec, readonly alloc section is .rodata section. It is used.
This fix is to add back original check logic for ELF section. Now,
the readonly alloc section and execute alloc section are regarded as .text.
Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
parent
ab2b389e7a
commit
1b380aa603
|
@ -238,7 +238,8 @@ IsTextShdr (
|
|||
Elf_Shdr *Shdr
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC));
|
||||
return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC)) ||
|
||||
((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC));
|
||||
}
|
||||
|
||||
STATIC
|
||||
|
|
|
@ -246,7 +246,8 @@ IsTextShdr (
|
|||
Elf_Shdr *Shdr
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC));
|
||||
return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC)) ||
|
||||
((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC));
|
||||
}
|
||||
|
||||
STATIC
|
||||
|
|
Loading…
Reference in New Issue