patchelf 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f510dcd400f1ea47ee4f7740f7f64a01e392b1e8230c4065aa3456541446ca6a
4
- data.tar.gz: 3196e51a7a26fe50d83341a8552645e6855f880d2ba6ca337dc856424ec0bbdd
3
+ metadata.gz: 1edf0d9c59559ab91a8aa9725a54d70002bc45b805b1186d7c601e042bc2114a
4
+ data.tar.gz: 8640e0da10909f2552b92bb337d7d777249271c256984ab811e887cff9d86e4f
5
5
  SHA512:
6
- metadata.gz: 4a7595a75b43139c254f2b25c1f2a3effd97d4e0c8ad0227c6493eee043904a6ee73bdc16fd46ff2276bcd6b3b595878f1ea8e2bdba8b1c34e85131379db7687
7
- data.tar.gz: b766c4045369095334d768002a07ff9a2d8b7193134b865e0b0d2e9443716cfc92927ca980fcf7e3053314d17ef1a63cc5fff017a5bcb8805a69ca2aae5c953a
6
+ metadata.gz: f54378fc9342220fc42cb843b1b2e0312e3bcc99269338526c38c0e3ec9f655c29ac97578d02cbdeb59e92565d60670a6a164f1ffb9dfcb4d6cc1ddfd4c5d13f
7
+ data.tar.gz: 48fb3d8d3b6eab76d90df2c6850b9d322f38669cb4347ad28b7ce3536ece630289b511fd5585fb2e052e705491352190177a358e79fb13265c73fdfcc02323a6
@@ -13,6 +13,8 @@ module PatchELF
13
13
  # @!macro [new] note_apply
14
14
  # @note This setting will be saved after {#save} being invoked.
15
15
 
16
+ attr_reader :elf # @return [ELFTools::ELFFile] ELF parser object.
17
+
16
18
  # Instantiate a {Patcher} object.
17
19
  # @param [String] filename
18
20
  # Filename of input ELF.
@@ -124,7 +126,23 @@ module PatchELF
124
126
  # Get runpath.
125
127
  # @return [String?]
126
128
  def runpath
127
- @set[@rpath_sym] || runpath_
129
+ @set[@rpath_sym] || runpath_(@rpath_sym)
130
+ end
131
+
132
+ # Get rpath
133
+ # return [String?]
134
+ def rpath
135
+ @set[:rpath] || runpath_(:rpath)
136
+ end
137
+
138
+ # Set rpath
139
+ #
140
+ # Modify / set DT_RPATH of the given ELF.
141
+ # similar to runpath= except DT_RPATH is modifed/created in DYNAMIC segment.
142
+ # @param [String] rpath
143
+ # @macro note_apply
144
+ def rpath=(rpath)
145
+ @set[:rpath] = rpath
128
146
  end
129
147
 
130
148
  # Set runpath.
@@ -182,8 +200,8 @@ module PatchELF
182
200
  end
183
201
 
184
202
  # @return [String?]
185
- def runpath_
186
- tag_name_or_log(@rpath_sym, "Entry DT_#{@rpath_sym.to_s.upcase} not found.")
203
+ def runpath_(rpath_sym = :runpath)
204
+ tag_name_or_log(rpath_sym, "Entry DT_#{rpath_sym.to_s.upcase} not found.")
187
205
  end
188
206
 
189
207
  # @return [String?]
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PatchELF
4
4
  # Current gem version.
5
- VERSION = '1.0.0'.freeze
5
+ VERSION = '1.1.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patchelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - david942j
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-03 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elftools