diff options
| author | Ulrich Drepper <[email protected]> | 2007-02-05 07:25:33 +0000 |
|---|---|---|
| committer | Ulrich Drepper <[email protected]> | 2007-02-05 07:25:33 +0000 |
| commit | aa915fd3d70b4cbe4581f9ec170d986c6ba35063 (patch) | |
| tree | 7345e23df9aa4cfcab4eb9afafa0dac6ed16e182 /src | |
| parent | ce0bdb6ee5f977af9e565f2871ba2b1b37d162a5 (diff) | |
propagate from branch 'com.redhat.elfutils.roland.pending' (head c44dcfac5b545aecb173fede31f34cb003be0173)
to branch 'com.redhat.elfutils' (head 4196d4e01486bdeb0c0632291881d1c6d7163fab)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/elflint.c | 25 |
2 files changed, 24 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6e619e0d..c2ce90fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-01-11 Roland McGrath <[email protected]> + + * elflint.c (check_sections): Use ebl_machine_section_flag_check on + SHF_MASKPROC bits separately from generic sh_flags validation. + 2007-02-04 Ulrich Drepper <[email protected]> * ar.c: New file. diff --git a/src/elflint.c b/src/elflint.c index 79e52299..09c7fbd2 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -3338,12 +3338,25 @@ section [%2zu] '%s': size not multiple of entry size\n"), #define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \ | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \ | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS) - if (shdr->sh_flags & ~ALL_SH_FLAGS) - ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)" - " %#" PRIx64 "\n"), - cnt, section_name (ebl, cnt), - (uint64_t) shdr->sh_flags & ~(uint64_t) ALL_SH_FLAGS); - else if (shdr->sh_flags & SHF_TLS) + if (shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS) + { + GElf_Xword sh_flags = shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS; + if (sh_flags & SHF_MASKPROC) + { + if (!ebl_machine_section_flag_check (ebl, + sh_flags & SHF_MASKPROC)) + ERROR (gettext ("section [%2zu] '%s'" + " contains invalid processor-specific flag(s)" + " %#" PRIx64 "\n"), + cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC); + sh_flags &= ~(GElf_Xword) SHF_MASKPROC; + } + if (sh_flags != 0) + ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)" + " %#" PRIx64 "\n"), + cnt, section_name (ebl, cnt), sh_flags); + } + if (shdr->sh_flags & SHF_TLS) { // XXX Correct? if (shdr->sh_addr != 0 && !gnuld) |
