[PATCH] elf: Fix tst-relro-symbols.py argument passing

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Dec 14 21:20:36 GMT 2022


Current scheme only consideres the first argument for both --required
and --optional, where the idea is to append a new item.

Checked on x86_64-linux-gnu.
---
 elf/tst-relro-symbols.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/elf/tst-relro-symbols.py b/elf/tst-relro-symbols.py
index 368ea3349f..41e87b37ea 100644
--- a/elf/tst-relro-symbols.py
+++ b/elf/tst-relro-symbols.py
@@ -56,10 +56,10 @@ def get_parser():
     """Return an argument parser for this script."""
     parser = argparse.ArgumentParser(description=__doc__)
     parser.add_argument('object', help='path to object file to check')
-    parser.add_argument('--required', metavar='NAME', default=(),
-                        help='required symbol names', nargs='*')
-    parser.add_argument('--optional', metavar='NAME', default=(),
-                        help='required symbol names', nargs='*')
+    parser.add_argument('--required', metavar='NAME', action='append',
+                        help='required symbol names')
+    parser.add_argument('--optional', metavar='NAME', action='append',
+                        help='required symbol names')
     return parser
 
 def main(argv):
-- 
2.34.1



More information about the Libc-alpha mailing list