X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Ftls.h;h=e91610fbb1b2e8703c9895bd326f5d2fd5cd3d2c;hb=5430098f1807e084fe4ff5057040d68435f3d8a2;hp=7103d3febb3ec12e368420df8cc520688978b496;hpb=75f2446ec3c13eca3fe0c7cfdbb232e760d36596;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/tls.h b/gold/tls.h index 7103d3febb..e91610fbb1 100644 --- a/gold/tls.h +++ b/gold/tls.h @@ -1,6 +1,6 @@ // tls.h -- Thread-Local Storage utility routines for gold -*- C++ -*- -// Copyright 2006, 2007 Free Software Foundation, Inc. +// Copyright (C) 2006-2017 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -50,10 +50,11 @@ inline void check_range(const Relocate_info* relinfo, size_t relnum, typename elfcpp::Elf_types::Elf_Addr rel_offset, - off_t view_size, off_t off) + section_size_type view_size, int off) { - off_t offset = rel_offset + off; - if (offset < 0 || offset > view_size) + typename elfcpp::Elf_types::Elf_Addr offset = rel_offset + off; + // Elf_Addr is unsigned, so this also tests for signed offset < 0. + if (offset > view_size) gold_error_at_location(relinfo, relnum, rel_offset, _("TLS relocation out of range")); }