summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Shlibs
AgeCommit message (Collapse)AuthorFilesLines
2019-11-26Merge https://salsa.debian.org/dpkg-team/dpkgIgor Pashev3-16/+31
2019-01-15Dpkg::Shlibs::Objdump: Only select objdump program when going to use itGuillem Jover1-10/+13
Running code in the module scope means that anything importing the module will execute that code, which is undesirable. Move the initialization into a _select_objdump() sub, which gets assigned into a state variable on demand.
2019-01-15Dpkg::Shlibs::Objdump: Remove unused Dpkg::IPC importGuillem Jover1-1/+0
The spawn() call was removed but not the matching import. Fixes: commit 8ae966ae7d3635b8359829085db4262923ceae96
2018-07-24Dpkg::Shlibs: Disable bool overload Dpkg::Version warningsGuillem Jover2-0/+8
The usage in this file is correct, but we are still doing boolean evaluation.
2018-07-24Dpkg::Shlibs::SymbolFile: Always assign proper Dpkg::Version to deprecatedGuillem Jover1-1/+1
We should always assign a proper Dpkg::Version object to the deprecated variable. Otherwise it can get confused with the scalar value 0 used on boolean context to denote it is *not* deprecated, instead of it being a version number 0.
2018-05-04Dpkg::Shlibs::Objdump: Fix ELF program detectionGuillem Jover1-2/+8
An ELF executable is defined by whether the object has the EXEC_P flag defined or an interpreter in the program header. The former applies to statically linked programs, the latter to dynamically linked programs and possibly some shared libraries that can be executed, such as the ones provided by glibc. This is now more relevant as PIE makes normal executables show up as shared objects, so they do not contain the EXEC_P flag, and were not being detected as executables.
2018-05-04Dpkg::Shlibs::Objdump: Remove duplicate assignment in reset() methodGuillem Jover1-1/+0
2018-01-16Dpkg::Shlibs::SymbolFile: Check that $state->{seen} exists instead of $state ↵Dmitry Shachnev1-1/+1
being defined Fixes: commit 0d2b3cee25b74dd3fd9ddc3a469b8b144368c963 Closes: #880166 Signed-off-by: Guillem Jover <guillem@debian.org>
2017-11-19Merge git://anonscm.debian.org/dpkg/dpkgIgor Pashev3-62/+194
2017-10-12scripts: Rename debarch_to_cpuattrs() to debarch_to_abiattrs()Guillem Jover1-2/+2
2017-09-24scripts: Use split() with ' ' instead of /\s+/Guillem Jover1-1/+1
2017-09-24Dpkg::Shlibs::SymbolFile: Avoid many function arguments in parse()Guillem Jover1-20/+24
Addresses: Subroutines::ProhibitManyArgs Warned-by: perlcritic
2017-08-26perl: Use -> operator for function variablesGuillem Jover1-2/+2
2017-05-20Dpkg::Util: Remove and replace with core module List::UtilGuillem Jover1-1/+1
Our current minimal Perl version contains a new enough List::Util module implementing none and any, and several other functions.
2017-05-06doc: Spelling fixesJosh Soref1-1/+1
Signed-off-by: Guillem Jover <guillem@debian.org>
2017-02-26Dpkg::Shlibs::Objdump: Do not parse bogus ELF binaries in get_format()Guillem Jover1-2/+2
If the ELF class or endianness are unknown or bogus, ignore the file. Reported-by: Niels Thykier <niels@thykier.net>
2017-02-26Dpkg::Shlibs::Objdump:Object: Warn for unknown exec formats in analyze()Guillem Jover1-0/+5
Emit an explicit warning whenever we cannot detect the format for an executable object, instead of delegating this to the subsequent objdump, and letting it die, which ca be canfusing and is not future-proof. Closes: #854536
2017-02-26Dpkg::Shlibs::Objdump: Fix read() error handling in get_format()Guillem Jover1-1/+6
The rest of the code handles non-binary files (ELF in this case) gracefully and ignores them, even though not very explicitly, as objdump will emit a warning that might be difficult to decrypt. We will still fail for other read failures that are not just short-reads, as those imply some actual problem with the passed files. Closes: #854536
2017-02-26Dpkg::Shlibs::Objdump: Do not special case EM_SPARC32PLUS for NetBSDGuillem Jover1-10/+1
The affected code in NetBSD was bogus, and has been removed now. So there is no point in trying to special case the EM_SPARC32PLUS ELF machine ID depending on the ELF class, for something that should never happen. Ref: https//gnats.netbsd.org/51925
2017-02-01Dpkg::Shlibs::Objdump: Mask ABI bits in flags for ARMGuillem Jover1-3/+0
These are too unreliable for exact matches. There are objects with EABIv4 in the wild, even when the current is EABIv5. The soft and hard float flags are not always set on armel and armhf respectively, although the Tag_ABI_VFP_args attribute in the the ARM attribute section should always be present on armhf. And there are cases were both soft and hard float flags are set at the same time(!). Mask all flags on ARM, so that we get back to the previous behavior with objdump. We can try to revisit this for a better matching during the dpkg 1.19.x cycle. Closes: #853793
2017-01-29Dpkg::Shlibs::Objdump: Map alternative or old ELF machines to canonical onesGuillem Jover1-0/+49
Some ELF binaries contain alternative or old ELF machine types, which should match with their canonical forms. Map those before encoding the ABI. We ignore some mappings for things that should certainly never appear in current systems. Of note are EM_PPC_OLD (17) that conflicts with EM_VPP550 (17), and EM_PJ_OLD (99) that conflicts with EM_SNP1K (99). Warned-by: rebootstrap
2017-01-28Dpkg::Shlibs::Objdump: Encode the ELF ABI as a big-endian byte streamGuillem Jover1-2/+3
This way when unpacking for output, the result gives meaningful results.
2017-01-28Dpkg::Shlibs::Objdump: Mask ELF machine bits for SH and MIPSGuillem Jover1-3/+1
These do not define the ABI, and seem to be set depending on the ISA used. Mask them for now, and postpone possibly making more fine-grained matching in the future.
2017-01-26dpkg-shlibdeps: Improve ELF ABI mismatch detectorGuillem Jover1-28/+99
The previous ELF ABI mismatch detector was very naïve, as the string returned by «objdump -a» is a very simplistic representation of the ELF ABI used. Switch to our own ELF header parser, so that we can distinguish based on the fields that define the object ABI. This is still not enough, and we will have collisions with things such as linux-i386 and hurd-i386, but most of the previously colliding objects are now filtered. This also makes us independent of objdump not supporting any unknown ELF object ABI. Closes: #849913
2015-09-14perl: Split overlong regexes into multiline extended regexesGuillem Jover1-2/+13
This should make the regular expressions easier to read and understand, and allows to add comments describing specific parts. Addresses RegularExpressions::RequireExtendedFormatting. Warned-by: perlcritic
2015-08-03Dpkg::Shlibs::Objdump: Support spaces in symbol namesGuillem Jover1-6/+6
The ELF spec does not disallow symbols with embedded spaces, so we should really be supporting those. This is required by Go shared libraries. Closes: #785344 Based-on-patch-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2015-07-16Merge git://anonscm.debian.org/dpkg/dpkgIgor Pashev4-75/+90
Conflicts: debian/changelog debian/dpkg.manpages lib/compat/strsignal.c scripts/Dpkg/Shlibs.pm
2015-05-30Dpkg::Shlibs::SymbolFile: Use map instead of foreach to initialize the hashGuillem Jover1-2/+2
2015-05-30Dpkg::Shlibs::SymbolFile: Do not replace #PACKAGE# in template modeGuillem Jover1-3/+9
These markers get instantiated when generating the output files, replacing them when generating a template is wrong.
2015-05-30scripts: Use the state keywordGuillem Jover1-32/+31
This moves the variables closer to the block they are being used in. And protects them from external access.
2015-05-30scripts: Add missing strict and warnings pragmas for submodulesGuillem Jover1-0/+3
2015-04-18debian: Update my copyright yearsGuillem Jover1-0/+1
2015-04-10Dpkg::Shlibs::Cppfilt: Remove unused IO::HandleGuillem Jover1-1/+0
2015-03-30perl: Rework use and exporter declarationsGuillem Jover3-7/+11
Place 'use' strict and warnings first, then Exporter 'our' declarations, then Test module imports, then system module imports, then Dpkg module imports, then 'use' parent and overload pragmas, separated by a blank line for each block. Split each exported symbol declaration into its own line to ease modifications.
2015-01-28Dpkg: Use shift instead of @_ on single argument unpackingGuillem Jover3-10/+10
2015-01-28scripts: Rename and deprecate _g function with g_Guillem Jover4-12/+12
The old function name was inconsistent with the other gettext family of short aliases which has already caused some code typos, and functions starting with underscore are considered by convention private in Perl.
2015-01-28dpkg-gensymbols: Add support for arch-bits and arch-endian tagsGuillem Jover1-5/+12
These allow to tag symbols as being only relevant on architectures with specific bits or endianness. The current supported values are 32 and 64 for arch-bits, and little and big for arch-endian. They can also be combined by using multiple tags on the same symbol. Closes: #630342
2015-01-28Dpkg::Shlibs::Symbol: Use new debarch_is_concerned() instead of Dpkg::DepsGuillem Jover1-6/+2
Stop abusing the Dpkg::Deps object just to get the architecture computation from it.
2014-10-23Merge tag '1.17.20' of git://anonscm.debian.org/dpkg/dpkgIgor Pashev4-27/+36
Release 1.17.20 Conflicts: debian/changelog scripts/Dpkg/Arch.pm
2014-10-06scripts: Unpack arguments just onceGuillem Jover2-9/+4
Addresses Subroutines::RequireArgUnpacking. Warned-by: perlcritic
2014-10-06scripts: Unpack arguments instead of accessing @_ directlyGuillem Jover1-7/+21
Addresses Subroutines::RequireArgUnpacking. Warned-by: perlcritic
2014-10-06perl: Do not use the topic variable unnecessarilyGuillem Jover2-3/+3
Fixes BuiltinFunctions::ProhibitUselessTopic and RegularExpressions::ProhibitUselessTopic. Warned-by: perlcritic
2014-10-06scripts: Use named variables instead of using the topic variableGuillem Jover1-8/+8
Switch code that uses roughly more explicit instances of the topic variable than implicit ones. Addresses BuiltinFunctions::ProhibitUselessTopic. Warned-by: perlcritic
2014-08-26Merge git://anonscm.debian.org/dpkg/dpkgIgor Pashev3-16/+15
Conflicts: cputable debian/changelog
2014-08-19scripts: Revert some unsafe //= usages back to ||=Guillem Jover1-1/+1
This reverts some of the unsafe assignments, as the variable might have contained a value evaluating to false, and we are assigning non-false values. This specifically fixes dpkg-source --commit and -b not working any longer. Regression introduced in commit b0337f001bee1f3791cb87505b1330c9bf83e2be. Closes: #758426 Reported-by: Neil Williams <codehelp@debian.org>
2014-08-09scripts: Use // instead of || where appropriateGuillem Jover2-3/+3
Replace only safe usages, i.e. those that fallback on initialization values that evaluate to false anyway. Or when the API is explicit about the variable being undefined.
2014-08-09scripts: Use //= instead of ||= when appropriateGuillem Jover1-1/+1
Replace only safe usages, i.e. those that fallback on initialization values that evaluate to false anyway. Or when the API is explicit about the variable being undefined.
2014-08-09scripts: Use //= instead of explicit defined or exists checksGuillem Jover2-11/+8
2014-05-17perl: Fix unused capture groups false positivesGuillem Jover1-2/+4
These are false positives, as when there's no match perl will leave the subpattern variables untouched. We'll just use the opportunity to unconfuse perlcritic, making some of those variable usages more clear by using intermediate variables. Fixes RegularExpressions::ProhibitUnusedCapture. Warned-by: perlcritic
2014-05-08Merge git://anonscm.debian.org/dpkg/dpkgIgor Pashev3-4/+7
Conflicts: debian/changelog utils/start-stop-daemon.c