~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/MC/MCSectionCOFF.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===- lib/MC/MCSectionCOFF.cpp - COFF Code Section Representation --------===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
 
 
10
#include "llvm/MC/MCSectionCOFF.h"
 
11
#include "llvm/MC/MCAsmInfo.h"
 
12
#include "llvm/MC/MCContext.h"
 
13
#include "llvm/MC/MCSymbol.h"
 
14
#include "llvm/Support/raw_ostream.h"
 
15
using namespace llvm;
 
16
 
 
17
MCSectionCOFF::~MCSectionCOFF() {} // anchor.
 
18
 
 
19
// ShouldOmitSectionDirective - Decides whether a '.section' directive
 
20
// should be printed before the section name
 
21
bool MCSectionCOFF::ShouldOmitSectionDirective(StringRef Name,
 
22
                                               const MCAsmInfo &MAI) const {
 
23
  
 
24
  // FIXME: Does .section .bss/.data/.text work everywhere??
 
25
  if (Name == ".text" || Name == ".data" || Name == ".bss")
 
26
    return true;
 
27
 
 
28
  return false;
 
29
}
 
30
 
 
31
void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI,
 
32
                                         raw_ostream &OS) const {
 
33
  
 
34
  // standard sections don't require the '.section'
 
35
  if (ShouldOmitSectionDirective(SectionName, MAI)) {
 
36
    OS << '\t' << getSectionName() << '\n';
 
37
    return;
 
38
  }
 
39
 
 
40
  OS << "\t.section\t" << getSectionName() << ",\"";
 
41
  if (getKind().isText())
 
42
    OS << 'x';
 
43
  if (getKind().isWriteable())
 
44
    OS << 'w';
 
45
  else
 
46
    OS << 'r';
 
47
  if (getCharacteristics() & COFF::IMAGE_SCN_MEM_DISCARDABLE)
 
48
    OS << 'n';
 
49
  OS << "\"\n";
 
50
  
 
51
  if (getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) {
 
52
    switch (Selection) {
 
53
      case COFF::IMAGE_COMDAT_SELECT_NODUPLICATES:
 
54
        OS << "\t.linkonce one_only\n";
 
55
        break;
 
56
      case COFF::IMAGE_COMDAT_SELECT_ANY:
 
57
        OS << "\t.linkonce discard\n";
 
58
        break;
 
59
      case COFF::IMAGE_COMDAT_SELECT_SAME_SIZE:
 
60
        OS << "\t.linkonce same_size\n";
 
61
        break;
 
62
      case COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH:
 
63
        OS << "\t.linkonce same_contents\n";
 
64
        break;
 
65
    //NOTE: as of binutils 2.20, there is no way to specifiy select largest
 
66
    //      with the .linkonce directive. For now, we treat it as an invalid
 
67
    //      comdat selection value.
 
68
      case COFF::IMAGE_COMDAT_SELECT_LARGEST:
 
69
    //  OS << "\t.linkonce largest\n";
 
70
    //  break;
 
71
      default:
 
72
        assert (0 && "unsupported COFF selection type");
 
73
        break;
 
74
    }
 
75
  }
 
76
}