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

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/MC/MCObjectStreamer.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/MCObjectStreamer.cpp - Object File MCStreamer Interface -----===//
 
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/MCObjectStreamer.h"
 
11
 
 
12
#include "llvm/Support/ErrorHandling.h"
 
13
#include "llvm/MC/MCAssembler.h"
 
14
#include "llvm/MC/MCCodeEmitter.h"
 
15
#include "llvm/MC/MCExpr.h"
 
16
#include "llvm/Target/TargetAsmBackend.h"
 
17
using namespace llvm;
 
18
 
 
19
MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
 
20
                                   raw_ostream &_OS, MCCodeEmitter *_Emitter)
 
21
  : MCStreamer(Context), Assembler(new MCAssembler(Context, TAB,
 
22
                                                   *_Emitter, _OS)),
 
23
    CurSectionData(0)
 
24
{
 
25
}
 
26
 
 
27
MCObjectStreamer::~MCObjectStreamer() {
 
28
  delete &Assembler->getBackend();
 
29
  delete &Assembler->getEmitter();
 
30
  delete Assembler;
 
31
}
 
32
 
 
33
MCFragment *MCObjectStreamer::getCurrentFragment() const {
 
34
  assert(getCurrentSectionData() && "No current section!");
 
35
 
 
36
  if (!getCurrentSectionData()->empty())
 
37
    return &getCurrentSectionData()->getFragmentList().back();
 
38
 
 
39
  return 0;
 
40
}
 
41
 
 
42
MCDataFragment *MCObjectStreamer::getOrCreateDataFragment() const {
 
43
  MCDataFragment *F = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
 
44
  if (!F)
 
45
    F = new MCDataFragment(getCurrentSectionData());
 
46
  return F;
 
47
}
 
48
 
 
49
const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) {
 
50
  switch (Value->getKind()) {
 
51
  case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!");
 
52
  case MCExpr::Constant:
 
53
    break;
 
54
 
 
55
  case MCExpr::Binary: {
 
56
    const MCBinaryExpr *BE = cast<MCBinaryExpr>(Value);
 
57
    AddValueSymbols(BE->getLHS());
 
58
    AddValueSymbols(BE->getRHS());
 
59
    break;
 
60
  }
 
61
 
 
62
  case MCExpr::SymbolRef:
 
63
    Assembler->getOrCreateSymbolData(cast<MCSymbolRefExpr>(Value)->getSymbol());
 
64
    break;
 
65
 
 
66
  case MCExpr::Unary:
 
67
    AddValueSymbols(cast<MCUnaryExpr>(Value)->getSubExpr());
 
68
    break;
 
69
  }
 
70
 
 
71
  return Value;
 
72
}
 
73
 
 
74
void MCObjectStreamer::SwitchSection(const MCSection *Section) {
 
75
  assert(Section && "Cannot switch to a null section!");
 
76
 
 
77
  // If already in this section, then this is a noop.
 
78
  if (Section == CurSection) return;
 
79
 
 
80
  PrevSection = CurSection;
 
81
  CurSection = Section;
 
82
  CurSectionData = &getAssembler().getOrCreateSectionData(*Section);
 
83
}
 
84
 
 
85
void MCObjectStreamer::Finish() {
 
86
  getAssembler().Finish();
 
87
}