[Issue 23139] New: object files containing several big static initializers require --no-relax to link

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 25 09:57:17 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23139

          Issue ID: 23139
           Summary: object files containing several big static
                    initializers require --no-relax to link
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

For the  following code

```d
__gshared int[10000][10000] a;
__gshared int[10000][10000] b;
__gshared int[10000][10000] c;
__gshared int[10000][10000] d;
__gshared int[10000][10000] e;
__gshared int[10000][10000] f;
__gshared int[10000][10000] g;
void main(string[] args){}    
```

compiled without special argument, linking fails and an error message suggest
to add the argument `--no-relax`.

1. this suggests that "--relax" is passed to the linker
2. the problem does not happen when using a list in the declarator, e.g

```d
__gshared int[10000][10000] a,b,c,d,e,f,g;
void main(string[] args){}    
```

this suggests that the first version use distinct initializers for each
variable, which, if verified seems wrong, as here only the type specific
initializer is used.

3. with -L--no-relax linking always work. Is the compiler able to add this
argument dynamically ?

--


More information about the Digitalmars-d-bugs mailing list