]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas/ELF: also reject merge entity size being zero
authorJan Beulich <jbeulich@suse.com>
Mon, 18 Nov 2024 10:35:57 +0000 (11:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Nov 2024 10:35:57 +0000 (11:35 +0100)
This won't have any useful effect, so is at best marginally less bogus
than a negative value.

The change actually points out a flawed (for Arm) testcase: @ is a
comment character there.

binutils/testsuite/binutils-all/debug_str.s
gas/config/obj-elf.c

index 485d0cc3187e50fdc22aeb27d41001618d1497d1..d8dc9c2e0f6c7e90e465db48529c02ce1141a662 100644 (file)
@@ -8,5 +8,5 @@
        resulting size was gigantic and consequently the library quickly ran out
        of memory.  */
 
-       .section        .debug_str,"MS",@progbits,1
+       .section        .debug_str,"MS",%progbits,1
        .string "ZLIB_VER_SUBREVISION 0"
index d8af4b720e0efa7ed6ca2d5cdfe2cbd8843bf522..4f09b8dc87cb48a55694f769308e9a4c3ec45d0e 100644 (file)
@@ -1327,7 +1327,7 @@ obj_elf_section (int push)
                goto fetch_entsize;
              entsize = get_absolute_expression ();
              SKIP_WHITESPACE ();
-             if (entsize < 0)
+             if (entsize <= 0)
                {
                  as_warn (_("invalid merge entity size"));
                  attr &= ~SHF_MERGE;